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

(PHP 8) Stacktrace with frames referring to anonymous classes are not grouped together #1314

Closed
toemat opened this issue May 12, 2022 · 2 comments
Milestone

Comments

@toemat
Copy link
Contributor

toemat commented May 12, 2022

Hi! I found this issue while trying to figure out why my events have not been grouped lately. I think PHP 8 changed the syntax of these anonymous class lines from {file}0x{mem} to {file}:{line}${mem}

PHP 7.x: class@anonymous/home/test.php0x7f76c7628065
PHP 8.x: class@anonymous/home/test.php:3$3e0a7

This seems to be the regex to remove the 0x style address, maybe adjust to match either 0x{hex} OR ${hex}?

$functionName = sprintf('%s::%s', preg_replace('/0x[a-fA-F0-9]+$/', '', $functionName), $backtraceFrame['function']);

So /0x[a-fA-F0-9]+$/ to /(\$|0x)[a-fA-F0-9]+$/

Does it seem like I'm on the right track? I can open a PR if that's best.

@ste93cry
Copy link
Collaborator

ste93cry commented May 12, 2022

Does it seem like I'm on the right track?

You are, indeed. I found that the change of the string format was done in php/php-src#0f2cdbf to fix a bug

I can open a PR if that's best.

It would be very welcome 😃

@stayallive
Copy link
Collaborator

Thanks for reporting and fixing it 💪


This has been resolved by #1315 and will be released shortly!

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

No branches or pull requests

3 participants