I want to know is it possible to have a class that's extended have a var set and used from the base class?
eg:
class me
{
public $hello = array();
protected function setter($me)
{
$this->hello[] = $me;
}
}
class foo extends me
{
public function __construct()
{
$this->setter('foo');
}
}
class yoo extends me
{
public function __construct()
{
parent::setter('yoo');
}
}
$me = new me();
$foo = new foo();
$yoo = new yoo();
print_r($me->hello);
the array printed is array() nothing is set.
memay be the base for the classesfooandyoobut the object$meis not the base of anything.