Re: Can't get zval write property handler working for ++/--/[]++ and other operators
| From: | Julien SALLEYRON | Date: | Mon, 31 Dec 2012 09:02:59 +0000 |
| Subject: | Re: Can't get zval write property handler working for ++/--/[]++ and other operators | ||
| References: | 1 2 3 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-10130@lists.php.net to get a copy of this message | ||
Hi,
As you can see here
http://lxr.php.net/xref/PHP_5_4/Zend/zend_vm_execute.h#25778
When you inc or dec, php try to get the ptr_ptr and then
increment/decrement directly without any call to zend_std_read_property or
zend_std_write_property.
In AOP, I have done like that
https://github.com/AOP-PHP/AOP/blob/master/aop.c#L287
(I'm not sure this is
the right/best solution but it works for me)
I have overloaded the get_property_ptr_ptr : If the current opcode is inc
or dec, then I return null in order to continue (
http://lxr.php.net/xref/PHP_5_4/Zend/zend_vm_execute.h#25792)
and call the
original read and write handler