Hi I have three classes. Fatal error: Call to a member function froma() on a non-object in Where is the error? How can I access object type property? I want to use all class over the one class ( main class). for example: $m->Config->get(); $m->Database->query("Select * From table"); $m->Input->getPost(); What is your suggestions?
i dont know is it possible to do double extend, u need class main extend class A, class B { ... } 1st option: use __call() 2nd class main extend class a { .... } class a extend class b { ... } class b { ... }
First I believe you are using php 4xx. __construct in php4 is not constructor. That's why $a and $b not initialized to objects. Second if you were using php 5+ you would end up in core dump. Coz you make stack overflow. main::__construct calls a's and b's implicit constructors when you use new and teh new()'s call main::__construct coz a and b extend main class.