Re: do_declare_property()
| From: | ggInternet) | Date: | Wed, 12 Jul 2000 08:59:35 +0000 |
| Subject: | Re: do_declare_property() | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-24276@lists.php.net to get a copy of this message | ||
On Wed, 12 Jul 2000, Andi Gutmans wrote:
> At 01:13 AM 7/12/00 +0200, Mathieu Kooiman (ggInternet) wrote:
> >Heh, well I think you can guess the way I implemented it..
> >I introduced private_properties to zend_class_entry
> >in do_declare_property():
> >
> >void do_declare_property(znode *var_name, znode *value CLS_DC)
> >{
> > HashTable *dest_ht;
> > if (var_name->op_type == ZEND_DECLARE_PRIVATE_PROPERTY)
> > dest_ht = &CG(active_class_entry)->private_properties;
> > else
> > dest_ht = &CG(active_class_entry)->default_properties;
> >
> > ... ectera ...
> >}
> >
> >and zend_fetch_property_address, now passes the complete container
> >rather than just container->value.obj.properties (Btw, why is this
> >completely _copied_?)
>
> What is completely copied?
ce->properties is _copied_ (zend_hash_copy) to
zval->value.obj.properties
Anyway, the way I implemented this totally sucks
and takes over 10 secs to use in a for loop with 100,000
iterations.. But for some reason accessing regular properties
is _faster_.. I dunno why though.
I will be searching for ways to speed this up though..
Other implementation:-)
>
>
> >When fetching the property, if it can't find in the properties hashtable,
> >it looks in the private_properties hashtable, if it does find them.. it
> >checks calling_symbol_table 'n stuff yada yada..
>
> See previous Email :)
>
> Andi
> ---
> Andi Gutmans <andi@zend.com>
> http://www.zend.com/
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>