|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-06-22 08:12 UTC] nikic@php.net
-Status: Open
+Status: Not a bug
[2013-06-22 08:12 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 12:00:01 2025 UTC |
Description: ------------ When using generators with an anonymous function neither an error nor the expected result are shown. Test script: --------------- foreach (function () { for ($i = 1; $i <= 10; ++$i) { yield $i => $i; } } as $key => $value) { echo $key . ': ' . $value . '<br>'; } Expected result: ---------------- Either: 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 10: 10 Or an error of some sort. Actual result: -------------- [neither result nor error]