Closed
Description
Description
The following code:
repro: https://3v4l.org/E8CsC
<?php
class Cl {
public static function createAnd(...$args)
{
var_dump($args);
}
public function bar()
{
static::createAnd(func_get_args()[0]);
}
}
(new Cl())->bar('y');
Resulted in this output:
Fatal error: Cannot use result of built-in function in write context
But I expected this output instead:
array(1) {
[0]=>
string(1) "y"
}
the 3v4l repro shows the issue is present only in some cases, when the same code is in non-class AST, it works
(func_get_args()[0]
should return the 1st argument, it is simplified repro from more complex usecase)
PHP Version
any
Operating System
any