diff options
author | Xinchen Hui <laruence@gmail.com> | 2016-03-01 19:19:07 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2016-03-01 19:19:07 +0800 |
commit | 186844be92d26a74ce61bd71d14053ae5be42602 (patch) | |
tree | ae3d82629e1810fb74a6ff9fe614e9f3e912ada5 /Zend/tests/bug71695.phpt | |
parent | 9fc0517328a248825703bef90d631ec687fb0d58 (diff) | |
download | php-git-186844be92d26a74ce61bd71d14053ae5be42602.tar.gz |
Fixed bug #71695 (Global variables are reserved before execution).
Instead of slow down hash_merge, we may also check the array(whether it
contains INDIRECT) outside of the loop, however, consisdering hash_merge
is not widly used, I prefer fix this in the current way to keep the
codes simple
Diffstat (limited to 'Zend/tests/bug71695.phpt')
-rw-r--r-- | Zend/tests/bug71695.phpt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Zend/tests/bug71695.phpt b/Zend/tests/bug71695.phpt new file mode 100644 index 0000000000..6747ce0e14 --- /dev/null +++ b/Zend/tests/bug71695.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #71695 (Global variables are reserved before execution) +--FILE-- +<?php +function provideGlobals() { + var_dump(array_key_exists("foo", $GLOBALS)); + var_dump(isset($GLOBALS["foo"])); + $GLOBALS += array("foo" => "foo"); +} + +provideGlobals(); +echo $foo; +?> +--EXPECT-- +bool(false) +bool(false) +foo |