Skip to content

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