Bug #71721 [NEW]: array_key_exists on $GLOBALS

From: Date: Sun, 06 Mar 2016 08:31:26 +0000
Subject: Bug #71721 [NEW]: array_key_exists on $GLOBALS
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199627@lists.php.net to get a copy of this message
From: asylow at free dot fr Operating system: PHP version: 7.0.4 Package: *General Issues Bug Type: Bug Bug description:array_key_exists on $GLOBALS Description: ------------ Testing $GLOBALS with array_key_exists() gives TRUE as soon as the variable is names anywhere in the code. This behaviour was not reproduced in PHP7.0.0 or PHP5. Test script: --------------- <?php var_dump(array_key_exists('var', $GLOBALS)); // false ?> with a var affected after : <?php var_dump(array_key_exists('var', $GLOBALS)); // true $var = 'foo'; ?> with a var simply named in the code: <?php var_dump(array_key_exists('var', $GLOBALS)); // true if (1 == 0) { $var = 'foo'; } ?> Expected result: ---------------- All tests should give false. -- Edit bug report at https://bugs.php.net/bug.php?id=71721&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71721&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71721&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71721&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=71721&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=71721&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=71721&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=71721&r=needscript Try newer version: https://bugs.php.net/fix.php?id=71721&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=71721&r=support Expected behavior: https://bugs.php.net/fix.php?id=71721&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=71721&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=71721&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=71721&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71721&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=71721&r=dst IIS Stability: https://bugs.php.net/fix.php?id=71721&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=71721&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=71721&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=71721&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=71721&r=mysqlcfg

« previous php.bugs (#199627) next »