|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-07-10 00:40 UTC] stepheneliotdewey at gmail dot com
[2009-07-10 18:12 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 18:00:01 2025 UTC |
Description: ------------ If you look at the final print-out for the below, it will print a, b, b, instead of the expected a, b, c. I don't think this is the expected behavior. Reproduce code: --------------- <?php $a = array('a', 'b','c'); foreach($a as &$row){ //you don't have to do anything here } print_r($a); foreach($a as $row){ echo "<br />".$row; } ?> Expected result: ---------------- a b c Actual result: -------------- a b b