Hi, I'm working on the AOP_PHP extension (http://pecl.php.net/package/AOP dedicated to bring the AOP paradigm to PHP (may it be evil or not)) and I'm struggling to make it compatible with PHP 5.5
As you probably expect, as the AOP paradigm is something like a magical hook, I have to overload the zend_execute function (and zend_execute_ex in PHP 5.5). Sometimes, I want to call the hooks before the execution of the actual called method. If an exception is raised in the hook, I won't always call the former called method. This was working like a charm in PHP 5.4.X (zend_execute) and before, but in PHP 5.5(zend_execute_ex) I have troubles with memory management. First, it seems that if I don't replace the EG(execute_data) by EG(execute_data)->prev_execute_data, I end in a infinite loop. If I EG(execute_data) = EG(execute_data)->prev_execute_data, there is no loop anymore, but I have freeing error (apparently in zend_clear_multiple_stack). I've tried to zend_stack_push(0) in order to *not* free any arguments in the stack (as I don't have any), but trying this, I still have another freeing error in the handle of the exception because there is a loop (and freeing) until we can get the zend_vm_stack_frame_base(). Am I doing wrong ? Any pointers ? Is there something simplier to just ignore the real execution without having memory problem ? Thanks for your time and help.