|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-05-30 20:34 UTC] pajoye@php.net
-Status: Open
+Status: Bogus
[2010-05-30 20:34 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 05:00:01 2025 UTC |
Description: ------------ The test script manipulates the last entry of $my_array instead of all or leaving everything as it is. my php version: 5.2.10 Test script: --------------- <? $my_Array[] = 'a'; $my_Array[] = 'b'; $my_Array[] = 'c'; $my_Array[] = 'd'; echo '<pre>1:' . print_r($my_Array, true) . '</pre>'; foreach($my_Array as &$value){ } echo '<pre>2:' . print_r($my_Array, true) . '</pre>'; foreach($my_Array as $value){ } echo '<pre>3:' . print_r($my_Array, true) . '</pre>'; ?> Expected result: ---------------- 3:Array ( [0] => a [1] => b [2] => c [3] => d ) Actual result: -------------- 3:Array ( [0] => a [1] => b [2] => c [3] => c )