Comment Inside yield from

Since PHP 8.3, there can be a comment, inserted between the yield and the from.

In previous versions, this would not compile, unless there was a defined constant called from.

PHP code

<?php

function foo() {
    yield /*a*/  from [3];
}

foreach(foo() as $i) {
    print $i;
}
?>

Before

PHP Fatal error:  Uncaught Error: Undefined constant "from"

Fatal error: Uncaught Error: Undefined constant "from"

After

3

PHP version change

This behavior changed in 8.3

Error Messages