foreach_temp_array_expr_with_refs.phpt   [plain text]


--TEST--
Temporary array expressions can be iterated by reference
--FILE--
<?php

$a = 'a';
$b = 'b';

foreach ([&$a, &$b] as &$value) {
    $value .= '-foo';
}

var_dump($a, $b);

?>
--EXPECT--
string(5) "a-foo"
string(5) "b-foo"