标签:
<?php class Car { function getName(){ echo "My name is " . get_class() . "<br>"; echo "My name is " . get_class($this) . "<br>"; } } //类内部调用 $bar = new Car(); $bar->getName(); //类外部调用 echo "Its name is " . get_class($bar) . "<br>"; ?>
运行结果
My name is Car
My name is Car
Its name is Car
标签:
原文地址:http://www.cnblogs.com/web-ed2/p/4316555.html