Skip to content

Fix incorrect anonymous class type name assertion #19316

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

Merged
merged 1 commit into from
Jul 31, 2025

Conversation

iluuu1994
Copy link
Member

Since GH-17755 self and parent are compile-time resolved. We may now also encounter this type error at runtime outside of the class itself.

Fixes GH-19304

Since phpGH-17755 self and parent are compile-time resolved. We may now also
encounter this type error at runtime outside of the class itself.

Fixes phpGH-19304
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this is also somewhat related to #18373 where maybe we shouldn't try resolving self for anonymous classes altogether

@iluuu1994
Copy link
Member Author

@Girgias Agreed, though I don't think this assertion is super useful to begin with.

@iluuu1994 iluuu1994 merged commit 049651d into php:master Jul 31, 2025
9 checks passed
@Girgias
Copy link
Member

Girgias commented Jul 31, 2025

@Girgias Agreed, though I don't think this assertion is super useful to begin with.

I think I added them while trying to figure out all the cases where it was not being resolved at compile time, and clearly I didn't find all the cases :)

@iluuu1994
Copy link
Member Author

This assertion was much older, actually. I.e. not added by yourself. 🙂

f9fbba4 (Daniil Gentili 2021-01-13 10:43:54 +0100 1396) ZEND_ASSERT(scope && "This should only happen with resolved types");

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

Successfully merging this pull request may close these issues.

Assertion failure in zend_compile.c found by php-fuzz-execute
2 participants