【发布时间】:2012-06-21 16:44:47
【问题描述】:
给定以下类:
<?php
class test{
static public function statfunc()
{
echo "this is the static function<br/>";
$api= new object;
}
}
class traductor
{
public function display()
{
echo "this is the object function";
}
}
test::statfunc();
$api->display();
这不会显示消息"this is the static function<br/>"。
有没有办法通过静态函数实例化并将该对象取出来?
谢谢...我对对象编程代码缺乏经验。
【问题讨论】:
标签: php class static-methods