|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-03-06 15:54 UTC] requinix@php.net
-Status: Open
+Status: Duplicate
[2016-03-06 15:54 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 06:00:02 2025 UTC |
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.