So I have to break away from my zeal for OOP and use data member chaning instead or am I missing something here?
Is there a way you can indeed chain function calls?
Thanks
Moderator: General Moderators
I just googled it seconds before your postJcart wrote:Not allowed in php4, althought here is a workaround http://blog.casey-sweat.us/?p=38
MUAHAHAHhahaha...Hockey wrote:So I have to break away from my zeal for OOP and use data member chaning instead or am I missing something here?
Aww, ruined the fun. Pout.Hockey wrote:So, PHP 5 supports function call chaining?
I'm a hardened OOP guy...for years I had private, public and protected access control then I started developing in PHP...Roja wrote:MUAHAHAHhahaha...Hockey wrote:So I have to break away from my zeal for OOP and use data member chaning instead or am I missing something here?
Aww, ruined the fun. Pout.Hockey wrote:So, PHP 5 supports function call chaining?
As do I, however sometimes, IMHO, syntactically it's cleaner and makes obviouse sense without the clutter of a few more lines...arborint wrote:I'm not sure that chaining is such a good idea anyway -- except maybe for accessors. I think it seems cooler than it is. There is an assumption that every method returns a valid object. I still prefer to explicitly assign to vars.
Code: Select all
$var1 = $var2 = $var3 = $var4 = 0;Code: Select all
$var1 = 0;
$var2 = 0;
$var3 = 0;
$var4 = 0;