Re: working with class inheritance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OOPS!... typo

Please replace implements with extends:

    class Child extends Parent

Sorry about that
""Jeff Taylor"" <jefftaylor@xxxxxxxxxxxxxxx> wrote in message
news:A1.92.40101.DAC9FF54@xxxxxxxxxxxxxxx
> 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
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux