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