Re: extending built in classes?

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

 



Dc wrote:
> Hi -
> 
> I am trying to extend a built in class, but cannot seem to get my
> subclass methods called.
> 
> class movObj extends SWFMovie {
>     function init() {
>        echo("init");
>     }
> }
> 
> $m = new movObj();
> $m->init();
> 
> Gives:::
> Fatal error: Call to undefined method SWFMovie::init() ...
> 
> This method call i would have hoped would pass up to the baseclass.
> 
> But if I add a constructor to my own subclass, the init method can be
> called. BUT i can now not call any of the SWFMovie methods. Like, it
> is not really extending the built in class, or there is no hierarchy.
> 
> I messed with various versiosn of trying to call the super myself:
> 
>    parent::method
>    $this->parent->method()
> 
> without much success.
> 
> Is this a limitation of phps classes? We cannot subclass built in types
> (perhaps they were built/not compatible with php5 object model)?
> 
> thanks!
> 
are you using php 4 or 5?

-- 
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