- Add check for Node\Arg instance before accessing arg properties - Skip non-Node\Arg arguments that represent callable placeholders - Prevent errors when processing first-class callables like $object->method(...) - Ensure property optimizer correctly handles variadic placeholders - Maintain existing refval function call detection logic - Add test case for first-class callable property optimization scenariomaster
parent
f79d40f8ee
commit
bca77588b5
2 changed files with 43 additions and 1 deletions
@ -0,0 +1,32 @@ |
|||||||
|
--TEST-- |
||||||
|
First-class callable placeholder is not treated as a call argument by property optimizer |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
use native_types; |
||||||
|
|
||||||
|
class FirstClassCallableTarget |
||||||
|
{ |
||||||
|
public int $counter = 0; |
||||||
|
|
||||||
|
public function tick(): void |
||||||
|
{ |
||||||
|
$this->counter++; |
||||||
|
} |
||||||
|
|
||||||
|
public function invoke(callable $callback): void |
||||||
|
{ |
||||||
|
$callback(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function main(): void |
||||||
|
{ |
||||||
|
$target = new FirstClassCallableTarget(); |
||||||
|
$target->invoke($target->tick(...)); |
||||||
|
var_dump($target->counter); |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
int(1) |
||||||
Loading…
Reference in new issue