-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Remove null byte from anonymous class name #18290
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
Comments
I solved at least some printing related issues (including one in phpdbg) regarding nul bytes in php errors/warnings. If you have a more concrete example of where this is still not done, please share it; otherwise this seems like a needless BC break to me. |
It's in the exception stack trace. class Test {
}
try {
$test = new class() extends Test {
public function run()
{
throw new Exception();
}
};
$test->run();
} catch (Throwable $e) {
var_dump($e->getTrace());
} And the result:
|
Indeed it's in the backtrace, but it's printed out properly. |
No feedback was provided. The issue is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so. Thank you. |
Description
I suggest removing the null byte from an anonymous class name, which can be visible in stack traces. Precisely, it's about this line: https://github.com/php/php-src/blob/master/Zend/zend_compile.c#L9024
It causes problems in observability and testing, and requires workarounds. Example I found:
The change is trivial, but it would be BC break.
The text was updated successfully, but these errors were encountered: