Re: Can't get zval write property handler working for ++/--/[]++ and other operators

From: Date: Mon, 31 Dec 2012 09:37:36 +0000
Subject: Re: Can't get zval write property handler working for ++/--/[]++ and other operators
References: 1 2 3 4  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-10131@lists.php.net to get a copy of this message
On 12/31/2012 02:02 PM, Julien SALLEYRON wrote:
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
Hi, thanks. Tried your approach. Unfortunately, doesn't work for me: (--$w->data['i'] <= 0) and $w->stop(); results `PHP Notice: Undefined index: i'. I'm afraid, I have to implement get_property_ptr_ptr handlers for each zval property. -- Regards, Ruslan Osmanov http://osmanov-dev-notes.blogspot.com | @ruslan_osmanov | +998916818499

« previous php.pecl.dev (#10131) next »