|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-07-16 10:22 UTC] pajoye@php.net
[2005-07-16 10:47 UTC] s dot masugata at digicom dot dnp dot co dot jp
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 08:00:01 2025 UTC |
Description: ------------ KEY and VALUE of foreach are made the duplicate variable, strange operation is done. Reproduce code: --------------- <?php $arr = array("1","123","12345"); foreach ( $arr as $val => $val ) { // echo "debug {$val}\n"; // this comment is removed, stranger operation is done. } print_r( $arr ); ?> Expected result: ---------------- Array ( [0] => 1 [1] => 123 [2] => 12345 ) Actual result: -------------- Array ( [0] => 1 [1] => 2 [2] => ) /usr/local/src/php-4.4.0/Zend/zend_execute.c(2436) : Freeing 0x0838B164 (12 bytes), script=f.php