|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-02-20 10:44 UTC] rasmus@php.net
-Status: Open
+Status: Not a bug
[2012-02-20 10:44 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 09:00:02 2025 UTC |
Description: ------------ iterate an array which included both int(0) and string type key with foreach, and compare key and string value, get an error result! Test script: --------------- $test = array( 'str' => 'str', 0 => 0, 1 => 1 ); foreach ($test as $k=>$v) { if ('str' == $k) echo "$k == str \n"; } Expected result: ---------------- output 'str == str ' only Actual result: -------------- output: str == str 0 == str