Open
Description
Description
The following code:
<?php
error_reporting(E_ALL);
function &y()
{
yield null; // warning
yield; // no warning
}
foreach (y() as &$y);
Resulted in this output:
PHP Notice: Only variable references should be yielded by reference in /home/user10/test.php on line 5
But I expected this output instead:
PHP Notice: Only variable references should be yielded by reference in /home/user10/test.php on line 5
PHP Notice: Only variable references should be yielded by reference in /home/user10/test.php on line 6
PHP Version
PHP 8.2.24 (cli) (built: Sep 27 2024 04:16:10) (NTS)
Operating System
Debian GNU/Linux 12 (bookworm)