Bug #79600 [NEW]: Regression in 7.4.6 when yielding an array based generator

From: Date: Fri, 15 May 2020 08:47:28 +0000
Subject: Bug #79600 [NEW]: Regression in 7.4.6 when yielding an array based generator
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-227045@lists.php.net to get a copy of this message
From: pvandommelen at gmail dot com Operating system: PHP version: 7.4.6 Package: *General Issues Bug Type: Bug Bug description:Regression in 7.4.6 when yielding an array based generator Description: ------------ Also see the test script. When yielding a generator which is based on an array, the first element is returned twice. Test script: --------------- // https://3v4l.org/gYB16 function createArrayGenerator() { yield from [ 1, 2, ]; } function createGeneratorFromArrayGenerator() { yield from createArrayGenerator(); } foreach (createGeneratorFromArrayGenerator() as $value) { echo $value; } Expected result: ---------------- The entries 1 and 2 Actual result: -------------- The first entry twice, then the second -- Edit bug report at https://bugs.php.net/bug.php?id=79600&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79600&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79600&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79600&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79600&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79600&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79600&r=support Expected behavior: https://bugs.php.net/fix.php?id=79600&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79600&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79600&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79600&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79600&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79600&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79600&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79600&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79600&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79600&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79600&r=mysqlcfg

« previous php.bugs (#227045) next »