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
Commit ab12474
Browse filesBrowse the repository at this point in the historyBrowse files
Find the bound closure argument by its attribute when arguments are named
ParametersAcceptorSelector narrowed the $newThis parameter of Closure::bind()
to a closure variable's @param-closure-this type only when the closure was
the first argument. With named arguments the closure can be anywhere -
Closure::bind(newThis: $o, closure: $c) - and ClosureBindArgVisitor marks it
wherever it is, so look the marked argument up when the first one is named.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
if (is_array($sfSelected['php']) && in_array('newThis: stdClass', $sfSelected['php'], true)) {
2290
+
$sfClosureBindNarrowed++;
2291
+
}
2292
+
check($sfSelected['php'] === $sfSelected['native'], sprintf('ParametersAcceptorSelector parity: selectFromArgs() over the Closure::bind() call on line %d: %s vs %s', $sfCall->getStartLine(), json_encode($sfSelected['php']), json_encode($sfSelected['native'])));
2293
+
}
2294
+
check(count($sfClosureBindCalls) >= 5, 'scope-family: the fixture walk saw the Closure::bind() calls (' . count($sfClosureBindCalls) . ')');
2295
+
check($sfClosureBindNarrowed === 4, "scope-family: the closure-this override narrowed \$newThis in 4 Closure::bind() calls ($sfClosureBindNarrowed)");
0 commit comments