class foo {
function name()
{
echo "My name is " , get_class($this) , "\n";
}
}
// create an object
$bar = new foo();
// external call
echo "Its name is " , get_class($bar) , "\n";
// internal call
$bar->name();
php 获取对象的类名 get_class
最新推荐文章于 2021-09-14 23:12:33 发布