Description
Please note that when removing the ampersand at line 13 it seems to work but then it's no longer a reference.
<?php
function &moh()
{
static $o;
return $o;
}
// works
$jo = [0];
$jo[0] = &moh();
// shows error
$jo = [&moh()];
Resulted in this output:
Fatal error: Can't use function return value in write context in /home/user1/Schreibtisch/test.php on line 13
But I expected this output instead:
PHP Version
PHP 8.4.4
Operating System
3v4l
Description
Please note that when removing the ampersand at line 13 it seems to work but then it's no longer a reference.
Resulted in this output:
But I expected this output instead:
PHP Version
PHP 8.4.4
Operating System
3v4l