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

33 linhas
648 B
PHP

<?php
interface Interf1 { }
interface Interf2 { }
interface Interf3 { }
abstract class AC1 implements Interf2, Interf1 { }
abstract class AC2 extends AC1 { }
abstract class AC3 extends AC2 implements Interf3 { }
abstract class AC4 extends AC3 { }
class C1 extends AC4 { }
function array_some(array $array) {
foreach ($array as $value) {
if ($value) {
echo "Empty: ";
echo empty($value);
echo "\nBool: ";
echo $value ? "true" : "false";
echo "\n";
}
}
return "Done";
}
$a = new C1;
var_dump( array_some(array_map(function($v) { return $v instanceof Interf2; },
array($a))) );