|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-12-30 22:52 UTC] helldar at ai-rus dot com
[2017-12-30 22:59 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2017-12-30 22:59 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 16:00:01 2025 UTC |
Description: ------------ When searching for an integer "0" in the in_array function that does not contain it as a value, the function always returns true PHP 7.2.0RC3 (cli) (built: Sep 28 2017 16:28:14) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.2.0-dev, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.2.0RC3, Copyright (c) 1999-2017, by Zend Technologies with blackfire v1.18.0~linux-x64-non_zts72, https://blackfire.io, by SensioLabs Test script: --------------- $arr = ['Car', 'Images']; $key = 0; echo (string)in_array($key, $arr); // Returned: 1 OR $arr = ['Car', 'Images']; $key = 1; echo (string)in_array($key, $arr); // Returned: 0