php-src/tests/lang/bug24396.phpt

20 lines
331 B
Plaintext
Raw Normal View History

2003-06-30 17:30:16 +00:00
--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 7 too..
2003-06-30 17:30:16 +00:00
echo "($k => $v)\n";
$$k = $v;
}
?>
--EXPECT--
(a => 1)
(b => 2)
(c => 3)