Bug #75329 [Com]: in_array is REALLY not working

From: Date: Fri, 06 Oct 2017 17:50:19 +0000
Subject: Bug #75329 [Com]: in_array is REALLY not working
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211554@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75329&edit=1 ID: 75329 Comment by: peehaa@php.net Reported by: dutr4 at outlook dot com Summary: in_array is REALLY not working Status: Not a bug Type: Bug Package: *General Issues Operating System: Windows/Linux PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Check out what happens on 3v4l: https://3v4l.org/Ahkcs Previous Comments: ------------------------------------------------------------------------ [2017-10-06 17:48:49] peehaa@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Without the 3rd param it will cast data. So it REALLY works as expected :-) ------------------------------------------------------------------------ [2017-10-06 17:45:30] dutr4 at outlook dot com Description: ------------ http://sandbox.onlinephpfunctions.com/code/661cc810693c8da8b987f4ca8ed9272375ab1e92 for eg <?php $a = array('00', '000', 0); $ka = 'KA'; var_dump( in_array($ka, $a) ); will always return true in ANY version of PHP, please, this error is probably breaking a lot of systems and sites! Test script: --------------- <?php $a = array('00', '000', 0); $ka = 'KA'; var_dump( in_array($ka, $a) ); Expected result: ---------------- false Actual result: -------------- true ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75329&edit=1

« previous php.bugs (#211554) next »