[php-src] Issue #8155: std_object_handlers not interceptable?
| From: | WalterWoshid | Date: | Sat, 26 Feb 2022 15:43:55 +0000 |
| Subject: | [php-src] Issue #8155: std_object_handlers not interceptable? | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-240043@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8155
Author: WalterWoshid
### Description
I am trying to implement a Aspect-oriented-programming extension for PHP, but since
std_object_handlers got the const keyword, it seems to be impossible to
intercept every std_object_handlers instance/object. I tried it with a zend_extension,
but it seems not possible.
Overloading zend_execute_ex and zend_execute_internal for function
handling works with ease like this:
```c
original_zend_execute_ex = zend_execute_ex;
zend_execute_ex = aop_execute_ex;
```
Is there any other way to intercept read/write operations for every class/object instance in PHP?
And LD_PRELOAD is not a option, this library should be installable with PECL.
I'm sorry if this is not a real bug, I can't find a solution and I have been looking for
days.
### PHP Version
PHP 8.1.2
### Operating System
Ubuntu 20.04