working with class inheritance
| From: | Jeff Taylor | Date: | Tue, 20 Mar 2007 08:42:52 +0000 |
| Subject: | working with class inheritance | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-250887@lists.php.net to get a copy of this message | ||
Hey all, got a slight problem, where for some reasons my variables dont seem
to be getting stored in the child class:
e.g
class Parent
{
$private type;
public function __construct()
{
}
public function GetType()
{
return $this->type;
}
}
class Child implements Parent
{
$public function __construct()
$this->type= 'Child';
}
}
$Child= new Child();
echo $Child->getType;
Can u see any reason why the type would return null?
Thanks,
Jeff