Bug #74133 [Opn->Fbk]: PHP function in_array() return wrong.
| From: | requinix@php.net | Date: | Mon, 20 Feb 2017 08:20:14 +0000 |
| Subject: | Bug #74133 [Opn->Fbk]: PHP function in_array() return wrong. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207452@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74133&edit=1
ID: 74133
Updated by: requinix@php.net
Reported by: long dot it dot stu at gmail dot com
Summary: PHP function in_array() return wrong.
-Status: Open
+Status: Feedback
Type: Bug
-Package: PHP options/info functions
+Package: Arrays related
Operating System: Centos
PHP Version: 5.6.30
Block user comment: N
Private report: N
New Comment:
None of those four values exist in either of those two arrays.
Previous Comments:
------------------------------------------------------------------------
[2017-02-20 06:29:15] long dot it dot stu at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/security.globals
---
PHP function in_array() return False although it existing.
Test script:
---------------
<?php
$array_1 = range(1, 1.9, 0.1);
var_dump(in_array(1.7, $array_1));
array_2 = range(0, 0.9, 0.1);
var_dump(in_array(0.3, $array_2));
var_dump(in_array(0.6, $array_2));
var_dump(in_array(0.7, $array_2));
//=>it return false;
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74133&edit=1