Add compile-time warning on invalid parent use by morrisonlevi · Pull Request #3564 · php/php-src
This is a new attempt at fixing the issue from PR #3404.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer necessary, you can use ce->parent_name.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - will rework the patch.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikic How do I know if it's safe to use parent or parent_name in that union?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During compilation it should always be parent_name. Otherwise the ZEND_ACC_LINKED flag.
The changes for ::class handling here are not quite correct. If we add support for parent::class in constant expression contexts, then we also have to support it in cases where it can only be determined at runtime.
I've just fixed an existing related bug in 41af1e6.
I have refactored the ::class handling and introduced support for resolving parent::class during runtime constexpr eval.
I've committed the parent check as a hard error in a9e6667. I think the BC break here is both very minor and easy to fix, so going through a deprecation period is more trouble than it is worth.
jrfnl added a commit to PHPCompatibility/PHPCompatibility that referenced this pull request
Jun 14, 2019
jrfnl
mentioned this pull request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters