Language: keep original trait method under as alias (#22718) - #22727
Merged
Merged
Conversation
3 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
use T { foo as bar; }aliases — originalfoostays callable (method_existstrue). The VM/JIT previously renamed (unset the original).lib/VM.php,lib/JIT.php, andlib/Compiler/TraitComposedMethodResolver.php(php-src-strict;Zend/zend_traits.c).as protectedunchanged;foo as protected foo2keeps both.Closes #22718
Test plan
php -d memory_limit=512M vendor/bin/phpunit --filter TraitAdaptationTest→ OK (9)php -d memory_limit=512M vendor/bin/phpunit --filter trait_as_alias→ OK (6)Verification transcript
php-src ref:
Zend/zend_traits.ctrait alias adaptation.Made with Cursor