|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-08-04 23:30 UTC] jv at vip dot ie
Description: ------------ --- From manual page: http://www.php.net/function.in-array --- The result will output true, when it should output false. Yup, this is a pretty fundamental bug ;) Test script: --------------- $correct_answers = array('meter'); $my_answer = 0; echo in_array($my_answer, $correct_answers); Expected result: ---------------- false Actual result: -------------- true PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 14:00:02 2025 UTC |
This looks like a bug to me. It breaks the transitive property. if(0 == null) { echo "1<br>"; } if(0 == "meter") { echo "2<br>"; } if(null == "meter") { echo "3<br>"; } Expected result: ---------------- 1 Actual result: -------------- 1 2