- Notifications
You must be signed in to change notification settings - Fork8k
Closed
Description
Description
The following code (https://3v4l.org/pvIjH):
<?phpfunctionyieldFromIteratorGeneratorThrows() {try {yieldfromnewclass(newArrayIterator([1, -2]))extends IteratorIterator {publicfunctionkey() {if ($k =parent::key()) {thrownewException; }return$k; } }; }catch (Exception$e) {yield2; }}foreach (yieldFromIteratorGeneratorThrows()as$k =>$v) {var_dump($v);}
Resulted in this output:
int(1)
But I expected this output instead:
int(1)int(2)
PHP Version
PHP 7.2 - master
Operating System
No response