php class Car { function getName(){ echo "My name is " . get_class() . "
"; echo "My name is " . get_class($this) . "
"; } } //类内部调用 $bar = new Car(); $bar->getName(); //类外部调用 echo "Its name is " . get_class($bar) . "
"; ?>
运行结果
My name is Car
My name is Car
Its name is Car
以上就介绍了php get_class()函数,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
已抢66906个
抢已抢39513个
抢已抢21914个
抢已抢2777个
抢已抢3289个
抢已抢19401个
抢