【发布时间】:2012-11-29 05:44:37
【问题描述】:
调用父类函数更正确的方法是什么? parent:: 或 $this-> ?
class base{
public function get_x(){
return 'x';
}
}
class child extends base{
public function __construct(){
//this?
$x = parent::get_x();
//or this?
$x = $this->get_x();
}
}
谢谢!
【问题讨论】: