Bug #78759 [Ver->Csd]: array_search in $GLOBALS
| From: | nikic@php.net | Date: | Thu, 07 Nov 2019 10:17:57 +0000 |
| Subject: | Bug #78759 [Ver->Csd]: array_search in $GLOBALS | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223622@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78759&edit=1
ID: 78759
Updated by: nikic@php.net
Reported by: moonlighterr at gmail dot com
Summary: array_search in $GLOBALS
-Status: Verified
+Status: Closed
Type: Bug
Package: *General Issues
Operating System: any?
PHP Version: 7.4.0RC4
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5fa6dcd972e868fd6177b6620b44734d55eceab3
Log: Fixed bug #78759
Previous Comments:
------------------------------------------------------------------------
[2019-10-30 09:06:09] cmb@php.net
The $strict case is already broken as of PHP 7.0.0, the non
$strict case as of 7.4.0, see <https://3v4l.org/eFFTd>.
------------------------------------------------------------------------
[2019-10-29 21:58:13] moonlighterr at gmail dot com
Description:
------------
Seems array_search have some problems with $GLOBALS array. Direct index calling works fine,
searching by value in array_search not, similar with 'true' third parameter.
Test script:
---------------
$a = 22;
var_dump($GLOBALS["a"]); // int 22
var_dump(array_search(22, $GLOBALS)); // false
var_dump(array_search(22, $GLOBALS, true)); // false
Expected result:
----------------
$a = 22;
var_dump($GLOBALS["a"]); // int 22
var_dump(array_search(22, $GLOBALS)); // string "a"
var_dump(array_search(22, $GLOBALS, true)); // string "a"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78759&edit=1