|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-06-01 15:53 UTC] andrei at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 07:00:01 2025 UTC |
I am running: Apache/1.3.12 (Unix) mod_perl/1.21 PHP/4.0RC1 mod_ssl/2.6.2 OpenSSL/0.9.5 The problem is that in_array matches string vars as integer vars, for example the following code will work incorrectly: $a[0]="001"; $a[1]="003"; if (in_array("1", $a)) { echo "As if<br>"; } This is a big problem since it will cause the following code to produce an error: $HAObjects["0011"]=$Object; $HAObjects["0131"]=$Object; if (in_array("11", array_keys($HAObjects))) { $O=$HAObject["11"]; $O->SomeFunction(); }