Re: [PHP-DEV] zend_do_end_class_declaration() question From: Stefan Arentz (stefan.arentz <email protected>)
Date: 09/15/01

On Sat, Sep 15, 2001 at 11:42:18AM +0300, Andi Gutmans wrote:
> It's the correct place. It sounds weird what you're mentioning.
> do_inherit_parent_constructor() also checks ce->parent and it seems to work.
> Do you have a short script (class decelerations) which shows this behavior?
> What are you trying to accomplish?

I'm experimenting with some extra language features, like abstract class
methods (pure virtual functions in C++).

This is de PHP code:

  class BaseClass {
    function blah() {
      echo "blah\n";
    }
    abstract function foo($a, $b);
  }

  class DerivedClass extends BaseClass {
    function bar() {
      echo "bar\n";
    }
  }

And this is my new: zend_do_end_class_declaration():

 void zend_do_end_class_declaration(CLS_D)
 {
    do_inherit_parent_constructor(CG(active_class_entry));
    do_check_abstract_methods(CG(active_class_entry));
    CG(active_class_entry) = NULL;
 }

With do_check_abstract_methods:

 static void do_check_abstract_methods(zend_class_entry *ce)
 {
   if (ce->parent) {
      fprintf(stderr, "num = %d\n",
        zend_hash_num_elements(&ce->parent->abstract_methods));
   }

   ...
 }

This is with PHP 4.0.6.

Regards,

 Stefan

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>