Bug #75750 [Com]: PHP 7.2.0RC3 (cli) (built: Sep 28 2017 16:28:14) ( NTS )
| From: | helldar at ai-rus dot com | Date: | Sat, 30 Dec 2017 22:52:35 +0000 |
| Subject: | Bug #75750 [Com]: PHP 7.2.0RC3 (cli) (built: Sep 28 2017 16:28:14) ( NTS ) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-213332@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75750&edit=1
ID: 75750
Comment by: helldar at ai-rus dot com
Reported by: helldar at ai-rus dot com
Summary: PHP 7.2.0RC3 (cli) (built: Sep 28 2017 16:28:14) (
NTS )
Status: Open
Type: Bug
Package: Arrays related
Operating System: Irrelevant
PHP Version: 7.2.0
Block user comment: N
Private report: N
New Comment:
The bug works in the following versions of PHP: 5.6.29, 7.0.14, 7.1.12 and 7.2.0RC3.
Other versions I did not check.
Previous Comments:
------------------------------------------------------------------------
[2017-12-30 22:48:25] helldar at ai-rus dot com
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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75750&edit=1