Arquivos
hhvm/hphp/test/vm/qop.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

28 linhas
453 B
PHP

<?php
$arr = array(null, true, false, 0, 1, 0.0, 1.0, "", "foo", array(), array(1));
function id($x) {
var_dump($x);
return $x;
}
for ($i = 0; $i < count($arr); ++$i) {
$x = $arr[$i];
$y = id($x) ? id($x) : "blarg";
echo "---------\n";
var_dump($y);
echo "\n\n";
}
echo "********************\n";
for ($i = 0; $i < count($arr); ++$i) {
$x = $arr[$i];
$y = id($x) ?: "blarg";
echo "---------\n";
var_dump($y);
echo "\n\n";
}