Repository navigation
Language: inaccessible private/protected static → __callStatic (#25670) - #25680
Merged
Merged
Conversation
Match php-src get_static_method_fallback: when a static method exists but is not visible from the caller scope, dispatch __callStatic instead of throwing a private/protected Error. Co-authored-by: Cursor <cursoragent@cursor.com>
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
get_static_method_fallback/zend_std_get_static_method: when a static method exists but is inaccessible from the caller scope, dispatch__callStaticinstead of throwing a private/protectedError.tryDispatchCallStaticfor both missing-method (Language: __callStatic magic method — static call dispatch (Zend object handlers parity) #3273) and visibility-failure (Language: outside call to private static skips __callStatic (re-#3273, zend_object_handlers.c) #25670) paths.Closes #25670
php-src reference
Zend/zend_object_handlers.c—zend_std_get_static_method→get_static_method_fallback→__callStaticPHP implementation
lib/VM.php—initStaticCallablevisibility catch →tryDispatchCallStaticTest plan
CS_hid/m/CS_prot/m/p/pr/CS_hid/mvendor/bin/phpunit --filter magic_callstatic_private test/compliance/VMTest.php— OK (1 test)magic_call_staticstill OK__callStatic, private static still throwsErrorrelease-readiness --json→user_release_ready: yes(gen-0 seed stale warning only)Made with Cursor