You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A method call on a value of unknown type (closure, null) is dispatched to an unrelated class's __call instead of the closure method / an Error #292
8
10
Error: Call to undefined method Closure::nosuch()
Error: Call to a member function foo() on null
magic:anything
Actual (manticore 0ffa52e9, Darwin arm64)
magic:__invoke
magic:call
magic:anything
Tracking
Known-bug repro: tests/aot/repro/wrong/erased_receiver_method_call_routed_to_unrelated_call.php — bash tests/aot/xfail.sh -k erased_receiver_method_call_routed_to_unrelated_call reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.
This is the general form of #290. DeepClone::getHydrator() called ->bindTo() on a closure read back from a static-property array (self::$hydrators['stdClass'] ??= static function …), so the compiler saw an untyped receiver; with no class declaring bindTo but some class declaring __call, the call was routed to the last__call class with the tagged closure word as $this (segfault in RedisClusterNodeProxy::__call, first boot of symfony-app in dev).
Commit 7b0f6e2d on repro/reflection-param-defaults fixes only that one spelling (bindTo on an untyped receiver is treated as a closure when no class declares bindTo). The dispatch itself is untouched: a method call whose receiver is not an object of a class that declares the method (or has __call) should check the receiver at run time and either perform the closure method (__invoke, call, bindTo) or throw Error: Call to undefined method … / Call to a member function X() on null, never fall through to an unrelated __call.
The repro shows it for __invoke, Closure::call, an undefined method on a closure and a method call on null. A side effect of the heuristic: an untyped receiver that really is a __call object and gets ->bindTo() is now handled as a closure.
Also related: #293.
Activity
blacktrs commentedon Oct 16, 2026
Root cause and relation to #290
This is the general form of #290.
DeepClone::getHydrator()called->bindTo()on a closure read back from a static-property array (self::$hydrators['stdClass'] ??= static function …), so the compiler saw an untyped receiver; with no class declaringbindTobut some class declaring__call, the call was routed to the last__callclass with the tagged closure word as$this(segfault inRedisClusterNodeProxy::__call, first boot ofsymfony-appin dev).Commit
7b0f6e2donrepro/reflection-param-defaultsfixes only that one spelling (bindToon an untyped receiver is treated as a closure when no class declaresbindTo). The dispatch itself is untouched: a method call whose receiver is not an object of a class that declares the method (or has__call) should check the receiver at run time and either perform the closure method (__invoke,call,bindTo) or throwError: Call to undefined method …/Call to a member function X() on null, never fall through to an unrelated__call.The repro shows it for
__invoke,Closure::call, an undefined method on a closure and a method call onnull. A side effect of the heuristic: an untyped receiver that really is a__callobject and gets->bindTo()is now handled as a closure.Also related: #293.
Boot symfony-app in dev, codegen-independent CLI golden, prepare 0.15…