Bug #67762 [NEW]: in_array evaluates as true when it should not

From: Date: Mon, 04 Aug 2014 23:30:54 +0000
Subject: Bug #67762 [NEW]: in_array evaluates as true when it should not
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186971@lists.php.net to get a copy of this message
From: jv at vip dot ie Operating system: PHP version: Irrelevant Package: *General Issues Bug Type: Bug Bug description:in_array evaluates as true when it should not 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 -- Edit bug report at https://bugs.php.net/bug.php?id=67762&edit=1 --

« previous php.bugs (#186971) next »