Re: extended objects with read_property and get_property_ptr_ptr
| From: | Rob Richards | Date: | Wed, 07 Jul 2004 19:27:28 +0000 |
| Subject: | Re: extended objects with read_property and get_property_ptr_ptr | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-10955@lists.php.net to get a copy of this message | ||
From: Zeev Suraski
> It's not a correct fix :I get_ptr_ptr must return the address of an
> allocated zval *, one which can later be separated,
> etc. T(result->u.var).var.ptr doesn't fall into that category - it can be
> gone in the next opcode...
>
> The only safe way to return a zval ** is for the underlying object model
to
> implement get_ptr_ptr...
What is this then a catch 22? If get_ptr_ptr is implemented and returns an
allocated zval **, then you can run into problems using pre/post_incdec if
you need to rely on the read_property and write_property of those functions,
which are only hit if you return NULL from get_ptr_ptr, which then brings
one back full circle to getting an error in
zend_fetch_property_address_inner when returning a NULL zval **.
So, my question boils down to is this a problem in the engine, the extension
or a combination of both.
Thanks,
Rob