PHP Variable from extended class
- by Ste
I cant retrieve var from parent class:
class core {
var $variable;
var $test;
function __construct() {}
public function setVar($var)
$this->variable = $var;
}
}
class test extends core {
public function getVar() {
return $this->variable;
//also if i echo here i can't see !!!!
}
}
$core = new core();
$core->test = new test();
print $core->test->getVar();
Any help??