ID: 33719 Updated by: [EMAIL PROTECTED] Reported By: s dot masugata at digicom dot dnp dot co dot jp -Status: Open +Status: Bogus Bug Type: *General Issues Operating System: Solaris8 PHP Version: 4.4.0 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Use 2 different variables. Previous Comments: ------------------------------------------------------------------------ [2005-07-16 05:11:44] s dot masugata at digicom dot dnp dot co dot jp 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33719&edit=1