Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[12.x] Fix once() cache when used in extended static class #54094

Merged

Conversation

FrittenKeeZ
Copy link
Contributor

Using once() from an extending class in static context will return the same value of the extended class, or vice versa, depending on which class was called first.

This change pulls the closure context class using ReflectionFunctionAbstract::getClosureCalledClass() which is currently undocumented, though it was introduced in 8.1 (php/php-src#8932).

Although this is a breaking change, the use case is extremely narrow.

@taylorotwell taylorotwell merged commit 91f9068 into laravel:master Jan 6, 2025
27 checks passed
@FrittenKeeZ FrittenKeeZ deleted the fix-once-extended-static-class branch January 7, 2025 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants