早上好
第一个是代码
loader.php
class loader{
public $main_c;
function __construct(){
$this->main_c['one']=array("a","b","c");
$this->main_c['two']=array("e","f","g");
$this->loadtwo();
}
function loadtwo(){
require_once(home.php);
$browser=new browser();
$browser->add();
}
}
$loader=new loader();
home.php
class browser extends loader{
function __construct(){
print $this->main_c; //empty value
}
function add(){
print parent::$main_c //Fatal error: Access to undeclared static property: loader::$main_c
print parent::main_c; //Fatal error: Undefined class constant 'main_c'
}
}
事实上我需要在main_c中添加或更改
来自文件browser.php