|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-30 15:14 UTC] tony2001@php.net
[2005-11-30 15:37 UTC] stephan dot skusa at lippe-net dot de
[2005-11-30 15:44 UTC] tony2001@php.net
[2005-11-30 16:17 UTC] stephan dot skusa at lippe-net dot de
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 15:00:01 2025 UTC |
Description: ------------ The call of test() results into an endless loop. The first for() works well, the for() in the function is the problem. And the Problem appears even if the first for() is left out. Reproduce code: --------------- <?PHP $arr = array ('a' => 1, 'c' => 2); for (reset ($arr); $key = key ($arr); next ($arr)) { echo $key; } echo "PING"; function test() { global $arr; for (reset ($arr); $key = key ($arr); next ($arr)) { echo $key; } } test(); ?> Expected result: ---------------- Output of "acPINGac" Actual result: -------------- Endless Loop Output of "acPINGaaaaaaaaaaaaa ... to be continued"