mirror of
https://github.com/php/php-src.git
synced 2024-10-21 00:12:34 +00:00
20 lines
331 B
Plaintext
20 lines
331 B
Plaintext
|
--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)
|