Bug #78759 [Opn->Ver]: array_search in $GLOBALS

From: Date: Wed, 30 Oct 2019 09:06:09 +0000
Subject: Bug #78759 [Opn->Ver]: array_search in $GLOBALS
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223510@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: cmb@php.net Reported by: moonlighterr at gmail dot com Summary: array_search in $GLOBALS -Status: Open +Status: Verified Type: Bug Package: *General Issues Operating System: any? PHP Version: 7.4.0RC4 Block user comment: N Private report: N New Comment: 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>. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#223510) next »