|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-10-30 12:38 UTC] stas@php.net
[2005-10-30 19:04 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 06:00:01 2025 UTC |
Description: ------------ Consider the code below: it does not produce correct results on 4.4, 5.1 head, but worked in some 5.0 versions due to the fact that key() is defined as by-ref function in 5.0. Reproduce code: --------------- <? $state = array("one" => 1, "two" => 2, "three" => 3); function foo( &$state ) { $contentDict = end( $state ); for ( $contentDict = end( $state ); $contentDict !== false; $contentDict = prev( $state ) ) { echo key($state)."\n"; } } foo($state); ?> Expected result: ---------------- three two one Actual result: -------------- one one one