<?php
class Math{
static function squared($input){
echo $input*$input;
}
}
$math = new Math();
if($math instanceof Math){
echo 'yes';
}
instanceof是检查一个实例是不是该类衍生出来的。
PHP instanceof 的使用
最新推荐文章于 2021-05-29 10:26:23 发布