After implementation of #31, new issue is appeared: PHP FFI trampoline which is called during hook invocation is changing original scope to another one (FFI) and this is unexpcted for PHP engine. After that constructor in a class with property hooks can not access private or protected members in the same class because of incorrect scope.
Example of possible errors: Cannot access private property ZEngine\Stub\TestClass::$secret in ~/z-engine/src/ClassExtension/Hook/ReadPropertyHook.php:104
After implementation of #31, new issue is appeared: PHP FFI trampoline which is called during hook invocation is changing original scope to another one (FFI) and this is unexpcted for PHP engine. After that constructor in a class with property hooks can not access private or protected members in the same class because of incorrect scope.
To fix this issue,
EG(fake_scope)
could be used.