Allow inherited magic method to still run with calling class#3722
Merged
fabpot merged 1 commit intotwigphp:2.xfrom Aug 12, 2022
Merged
Allow inherited magic method to still run with calling class#3722fabpot merged 1 commit intotwigphp:2.xfrom
fabpot merged 1 commit intotwigphp:2.xfrom
Conversation
If a static method cannot be resolved to the calling class, but the calling class has, or inherits, a `__callStatic` handler, this allows the `__callStatic` handler to be used with the calling class, and not the inherited class as would occur with reflection. This allows systems such as Laravel facades to still work. Fixes twigphp#3716
cc643ea to
d1457a4
Compare
stof
approved these changes
Jul 6, 2022
Contributor
|
Thank you @nicolas-grekas. |
fabpot
added a commit
that referenced
this pull request
Dec 13, 2022
This PR was merged into the 2.x branch. Discussion ---------- Fix optimizing closures callbacks Follows #3722 and php/php-src#8932 Uses a dedicated method added to PHP 8.1.11 (and 8.0.24, but I feel like there is no need to make the check too complex for an outdated version. We just need a marker to make the code simpler when we'll bump to PHP >= 8.1.11.) Commits ------- 406b3e5 Fix optimizing closures callbacks
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.
This is #3719 ported to 2.x and improved a bit.
I also reported php/php-src#8932 because the underlying behavior of PHP is broken to me.
If a static method cannot be resolved to the calling class, but the calling class has, or inherits, a
__callStatichandler, this allows the__callStatichandler to be used with the calling class, and not the inherited class as would occur with reflection. This allows systems such as Laravel facades to still work.Fixes #3716