Arquivos
hhvm/hphp/test/vm/foreach.php
T
Jordan Delong 363d1bb20f Code move src/ -> hphp/
This change is mostly for FB internal organizational reasons.
Building is not effected beyond the fact that the target now
lands in hphp/hhvm/hhvm rather than src/hhvm/hhvm.
2013-02-11 02:10:41 -08:00

32 linhas
449 B
PHP

<?php
$x = array('1',2,'3');
foreach ($x as $k => $v) {
echo $k;
echo ' ';
echo $v;
echo "\n";
}
// Test case pretty much stolen from www
function array_glue($pre, $array, $post) {
foreach ($array as &$v) {
$v = $pre.$v.$post;
}
return $array;
}
function goo($arr) {
return array_glue('fub', $arr, '');
}
$array = array(1,2,3);
$array []= 400; // make it non-static
$new = goo($array);
var_dump($array);
var_dump($new);