[GIT-PULLS] [php-src] PR #22640: Fix GH-15375: nested "yield from" skips items after valid()/next()
[email protected] (iliaal)
| Newsgroups | php.git-pulls |
|---|---|
| Message-ID | <5aXsIFBExSdCeJLg2HphuRfQMs89DRoi7jHF6zWDUzw@main.internal.php.net> |
Pull Request: https://github.com/php/php-src/pull/22640 Author: iliaal Nested `yield from` drops the inner generator's current value on the second and later delegations when it was primed via `valid()`/`next()`. The `ZEND_GENERATOR_DO_INIT` guard in `zend_generator_resume()` reads the flag on `orig_generator`, but in a nested chain the fresh delegation is established by the middle generator, whose flag it never checks. Track and check the delegating generator instead. Fixes #15375