这是函数“TheFunctionILookFor”
$myClassName = "someName"; $parentOrInterfaceName = "someParent"; if ( theFunctionILookFor ($myClassName)) echo "is parrent";
发布于 2018-01-29 02:15:48
instanceof它可以用作类的“标识符”。
$temp ="tester"; $object = new sub(); var_dump($object instanceof $temp); //prints "true" on php 5.3.8 class tester{} class sub extends \tester{ }
发布于 2018-01-29 01:10:47
is_subclass_of可以将这两个参数改为字符串。
is_subclass_of
相似问题