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
最新推荐文章于 2025-02-24 13:57:08 发布