extending built in classes?

From: Date: Sat, 09 Oct 2004 15:09:18 +0000
Subject: extending built in classes?
Groups: php.general 
Request: Send a blank email to php-general+get-199073@lists.php.net to get a copy of this message
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!

« previous php.general (#199073) next »