About the magic function __call

From: Date: Wed, 27 Aug 2008 19:35:39 +0000
Subject: About the magic function __call
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-278830@lists.php.net to get a copy of this message
Hi there! I'm working with the following code: <?php abstract class Foo{ protected $a; protected $b; protected $c; function __construct($arg){ $this->a = $arg; } function __call($function, $args){ $this->b = $function; $this->c = $args; $this->doWhatever(); } private doWhatever(){ } } class Boo extends Foo{ protected $e; public function __construct(){ parent::__construct('Blah'); } public function drive(){ $e = 'testing'; parent::drive($e); } } $br = new Boo(); $br->drive(); But I get a Fatal error: Call to undefined method Foo::drive() The magic fuction __call don't catch the "drive()". Why not? I need another idea for this problem and avoid edit the abstract class. Sorry about the english. Thanks for any help

« previous php.general (#278830) next »