question about classes

From: Date: Mon, 12 Feb 2001 09:42:03 +0000
Subject: question about classes
Groups: php.dev 
Request: Send a blank email to php-dev+get-46414@lists.php.net to get a copy of this message
Hi, I implemented my own classes in an extension, but when I instanciate them, they don't have any properties. I called the macro INIT_OVERLOADED_CLASS_ENTRY (well, an equivalent that uses strlen() instead of sizeof()) cause I want to have write control over some properties:
          MGD_INIT_OVERLOADED_CLASS_ENTRY(
              (*midgard_class)->class_entry,
              (*midgard_class)->name,
              (*midgard_class)->methods,
              NULL,
              NULL,
              (*midgard_class)->set_property
          );
And (*midgard_class)->methods is a table that contains an alias of the same name as the class name (the constructor that creates all properties). But this constructor never gets called. I tried to implement the function call mechanism (replacing the first NULL above with (*midgard_class)->function_call) but then I have to strncmp() all the function names... Is there a way to call the constructor automatically ? -- Best Regards, David Guerizec Free Software Developer Aurora R&D dguerizec@aurora-linux.com Midgard core developer http://www.midgard-project.org/

« previous php.dev (#46414) next »