Re: parent_ctor()

From: Date: Tue, 18 Jul 2000 14:26:54 +0000
Subject: Re: parent_ctor()
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-24940@lists.php.net to get a copy of this message
At 15:19 18/07/2000 +0200, Kristian Köhntopp wrote:
Stanislav Malyshev wrote: KK>> $o->$somevar). Limiting object do class-predeclard instance variables KK>> may speed PHP - I haven't had a look at the implementation at all, No it won't. It would significantly slow down - you should check on any property request that it's in the list of "allowed" properties. Why does it have to? I assume PHP4 objects are hashlike structures (again, not having looked at the source), so that they can have any number of slots at runtime, with any names. So I also assume that $o->somevar is a hash lookup as well. I wonder why the hash cannot be fully populated at $o = new Someclass time, containing all declared variables and functions. If that were the case, an error would be raised when later $o->invalid_slot returns NULL, instead of silently creating $o->invalid_slot. Why is that slow? Or is the mental model I have of PHP objects wrong?
You would be seriously breaking backwards compatibility. Andi --- Andi Gutmans <andi@zend.com> http://www.zend.com/

« previous php.dev (#24940) next »