Page 1 of 1

chaining method compatibility problem ??

Posted: Fri Jan 02, 2009 11:02 pm
by PHPycho
Hello forums !!
I would like to know how to make the chaining methods compatible in both php4 and php5.
As we know chaining methods works only in php5.
Is there any hacks to make it work in php4 too.
My Chaining method working in PHP5 looks like:

Code: Select all

MyClass::getObject()->getObj('obj1')->getObj('obj2')->someMethod();
Any Help/suggestions would be highly appreciated.

Re: chaining method compatibility problem ??

Posted: Fri Jan 02, 2009 11:15 pm
by Chris Corbyn
Chaining doesn't work in PHP4 and there are no workarounds ;) You'll just have to do it the long way around unfortunately (or stop supporting PHP4 like Zend have).