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

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))) );