Arquivos
hhvm/hphp/test/quick/foreach.php
T
ptarjan 503f75d08b Rename test directories
These names don't make sense now that we run both suites the same
way.
2013-04-17 09:06:51 -07: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);