ok, something like this seems like it should work. Here is the situation:
I have a class that can print().
I have a function that returns an instance of this class, called get($str).
if i do something like this:
get("test")->print();
to call print from the class returned by get, then it gives a syntax error.
but if I do this:
$test = get("test");
$test->print();
it works fine.
So my question is, why doesn't it work without the intermediate variable? Is there a way to make is work like I want it?
I don't want to have to use that extra variable because it should work fine without it. (like in C++)