summaryrefslogtreecommitdiff
path: root/tests/lang/bug24396.phpt
blob: 80862191dee3923d39ba8dd32db1f0af4fda6add (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 7 too..
               
    echo "($k => $v)\n";
                       
    $$k = $v;          
}
?>
--EXPECT--
(a => 1)
(b => 2)
(c => 3)