|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-07-05 12:21 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2016-07-05 12:21 UTC] requinix@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 13 18:00:01 2025 UTC |
Description: ------------ There is an array with 3 values. These values are referenced by 3 string-keys. It seems that there is a implicit cast with the index '0' to int, so that (0 == "any string") is always true. but: ('0' == "any string") is always false, so there is no reason for that result. Test script: --------------- $kat['test'] = "a"; $kat['0'] = "b"; $kat['1'] = "c"; foreach ($kat as $key => $val) { if ($key != "test") $i++; } echo $i; Expected result: ---------------- 2 Actual result: -------------- 1