summaryrefslogtreecommitdiff
path: root/tests/lang/bug24396.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lang/bug24396.phpt')
-rw-r--r--tests/lang/bug24396.phpt19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/lang/bug24396.phpt b/tests/lang/bug24396.phpt
new file mode 100644
index 0000000000..b78e4b8757
--- /dev/null
+++ b/tests/lang/bug24396.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #24396 (global $$variable broken)
+--FILE--
+<?php
+
+$arr = array('a' => 1, 'b' => 2, 'c' => 3);
+
+foreach($arr as $k=>$v) {
+ global $$k; // comment this out and it works in PHP 5 too..
+
+ echo "($k => $v)\n";
+
+ $$k = $v;
+}
+?>
+--EXPECT--
+(a => 1)
+(b => 2)
+(c => 3)