Image

Imagesoltice wrote in Imagephp

Calling class function returned from function

Is there a syntax for doing something like the following:

$objectMethodResult = returnsObject()->objectMethod();


I've been able to do something like that in both C++ and Java, but PHP just doesn't seem to like it. Presently, I've done a similar operation by breaking up that line:

$object =& returnsObject();
$objectMethodResult = $object->objectMethod();


I know that the two are pretty much the same, and that I'm quibbling over a couple lines of code, but my curiousity has gotten the better of me.