给定以下类:
<?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/>"
。
有没有办法通过静态函数实例化并将该对象放在外面?
谢谢...我对对象编程代码缺乏经验。