|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-12-07 17:55 UTC] tony2001@php.net
[2004-12-07 22:13 UTC] DeyV at php dot pl
[2004-12-07 22:28 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 23:00:02 2025 UTC |
Description: ------------ In this version in foreach without $key parametr, the $value always is returned as array, when 0 => value 1 => key Reproduce code: --------------- $a = array ( 1 => 'test1', 2 => 'test2', "three" => 1, "four" => 2, "five" => 3 ); foreach( $a as $v ) { print $v."\n"; } var_dump( $v ); Expected result: ---------------- test test2 1 2 3 int(3) Actual result: -------------- Array Array Array Array Array array(2) { [0]=> int(3) [1]=> string(4) "five" }