Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Incorrect scope check for property hooks #32

Closed
lisachenko opened this issue Feb 6, 2020 · 2 comments · Fixed by #33
Closed

[Bug] Incorrect scope check for property hooks #32

lisachenko opened this issue Feb 6, 2020 · 2 comments · Fixed by #33
Labels
bug Something isn't working

Comments

@lisachenko
Copy link
Owner

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.

@lisachenko lisachenko added the bug Something isn't working label Feb 6, 2020
@lisachenko
Copy link
Owner Author

lisachenko commented Feb 6, 2020

See comment in #31 for additional details.

@lisachenko
Copy link
Owner Author

Example of possible errors: Cannot access private property ZEngine\Stub\TestClass::$secret in ~/z-engine/src/ClassExtension/Hook/ReadPropertyHook.php:104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant