Description
The following code:
<?php
error_reporting(E_ALL);
function &moh()
{
$test = 5;
yield &$test;
}
foreach (moh() as &$value)
var_dump($value);
Resulted in this output:
But I expected this output instead:
PHP Parse error: syntax error, unexpected token "&" in /home/user1/test.php on line 7
PHP Version
PHP 8.2.24
Operating System
Debian GNU/Linux 12 (bookworm)