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

Using the Lexer class in a shutdown function makes the last fatal error lost #735

Closed
ste93cry opened this issue Dec 1, 2020 · 3 comments · Fixed by #736
Closed

Using the Lexer class in a shutdown function makes the last fatal error lost #735

ste93cry opened this issue Dec 1, 2020 · 3 comments · Fixed by #736

Comments

@ste93cry
Copy link
Contributor

ste93cry commented Dec 1, 2020

While trying to debug some failing tests of the getsentry/sentry-php package I found out that PHPUnit since a while calls the parser with non-emulative lexing and that that code is executed inside a register_shutdown_function callback. Unluckily, the Lexer::startLexing() method calls error_clear_last() which clears the last catched fatal error and thus the next callback does not know anything about it anymore. I cannot find any call to error_get_last() in the source code and so I cannot think about what is the purpose of clearing the error, so I was wondering if it would be possible to remove that function call

@nikic
Copy link
Owner

nikic commented Dec 1, 2020

This is a leftover from an earlier implementation that did use error_get_last(). It should be fine to drop the call now.

@ste93cry
Copy link
Contributor Author

ste93cry commented Dec 3, 2020

Do you plan to release a patch version soon? This issue is blocking one project I'm contributing to because the tests are broken

@nikic
Copy link
Owner

nikic commented Dec 3, 2020

@ste93cry Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants