Skip to content

Language: inaccessible private/protected static → __callStatic (#25670) - #25680

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-25670-callstatic-private
Jul 31, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-25670-callstatic-private

Conversation

@PurHur

@PurHur PurHur commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #25670

php-src reference

  • Zend/zend_object_handlers.c — zend_std_get_static_method → get_static_method_fallback → __callStatic

PHP implementation

  • lib/VM.php — initStaticCallable visibility catch → tryDispatchCallStatic

Test plan

  • Issue repro (VM matches Zend):
    ./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/issue_25670_callstatic_private.php'
    
    Output: CS_hid / m / CS_prot / m / p / pr / CS_hid / m
  • vendor/bin/phpunit --filter magic_callstatic_private test/compliance/VMTest.php — OK (1 test)
  • Existing magic_call_static still OK
  • Without __callStatic, private static still throws Error
  • Gate snapshot (pre-claim): inventory OK 6639/6639; release-readiness --json → user_release_ready: yes (gen-0 seed stale warning only)

Made with Cursor

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>
@PurHur
PurHur merged commit 16277a8 into master Jul 31, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-25670-callstatic-private branch July 31, 2026 02:01
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.

Language: outside call to private static skips __callStatic (re-#3273, zend_object_handlers.c)

1 participant