Re: print_r unaware of object's read_property handler
| From: | Piotr Pokora | Date: | Thu, 15 Feb 2007 22:50:48 +0000 |
| Subject: | Re: print_r unaware of object's read_property handler | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-4544@lists.php.net to get a copy of this message | ||
> On 02/16/2007 12:05 AM, Piotr Pokora wrote:
>> How can I say...?
>> One framework has clear rules for objects and properties and another one
>> has not :)
>
> Which means you're not bound to any rules and free to do anything you
> like.
> Isn't it great? Isn't it C?
As great as this song "you can do it your own way , if it's done just how I say" ;)
>> 1. Set object's properties in constructor.
>> Bad for derived classes which use own constructor.
>>
>> 2. Update ce.default_properties hash when class is registered.
>> Is it safe? ZEND1 segfaulted with such implementation.
> Why don't you look into
> http://cvs.php.net/pecl/swish/swish.c and find an
> example demonstrating how this stuff works?
Well, I can not find any suitable part of the code either in object's constructor or when class
is registered.
That's why I asked.
The simplest solution seems to be update default_properties of class pointer returned by
zend_register_internal_class. It should work for derived classes too, right?
Piotras