...

View Full Version : $a->b()->c() no go in php



jkd
06-25-2005, 01:16 PM
Any good reason why that doesn't work? If the b() method returns an instance of an object, why does PHP still die on the syntax?

Harry Armadillo
06-25-2005, 10:31 PM
Heh heh. I've tried the same js-style shortcuts and had the same failures.

As far as I've been able to discover, php simply does not support referencing into anonymous objects. If a method returns an object, it has to be assigned to a variable before you can access it's interior.

jkd
06-26-2005, 12:15 AM
I figured as much. *wonders why PHP is so popular*

Thanks. :)

Kurashu
06-26-2005, 12:39 AM
Open source, free, easy the learn, widely supported. =P

jkd
06-26-2005, 03:03 AM
Open source, free, easy the learn, widely supported. =P

It was more of a rhetorical question. I still think the language is crippled though. And I'm sure there are threads here to debate the contrary.

marek_mar
06-26-2005, 10:03 PM
It should work as of PHP5.0.0



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum