Skip to content

Conversation

timurib
Copy link
Contributor

@timurib timurib commented Jan 9, 2018

Extending an undefined class causes the fatal error instead of throwing Error exception.
Relevant issue: https://bugs.php.net/bug.php?id=75765

The previous patch contained a fix for "implements" handling, but it had errors, so I removed all related with interfaces and made a new PR.

@krakjoe krakjoe added the Bug label Jan 10, 2018
@nikic
Copy link
Member

nikic commented Jan 12, 2018

Merged as a484b9a into master. Thanks!

To support the same for interfaces/traits, the basic idea would be to have a separate opcode like COMMIT_CLASS, which separates the addition of the class to the hashtable from the binding procedure, in which case all binding errors could become exceptions. This part I would assume to be relatively straightforward. The issue is that the inheritance logic also modifies the class in-place, this means that it's not possible to run inheritance on a class entry twice (e.g. after defining a necessary interface that previously threw). Solving that part wouldn't be so simple.

@nikic nikic closed this Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants