About the magic function __call

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

 



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

[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