<?php
class MyClass
{
}
class NotMyClass
{
}
$a = new MyClass;
var_dump($a instanceof MyClass);
var_dump($a instanceof NotMyClass);
?>
以上例程会输出:
bool(true) bool(false)
<?php
class MyClass
{
}
class NotMyClass
{
}
$a = new MyClass;
var_dump($a instanceof MyClass);
var_dump($a instanceof NotMyClass);
?>
以上例程会输出:
bool(true) bool(false)
转载于:https://www.cnblogs.com/jerrypro/p/6412172.html