No, it's not because it returns void, as I've tried it with putenv and other functions that return void and they work fine. You can get it to work using print() instead of echo.
Remember that echo isn't actually a function, it's a language construct. I think that might have something to do with it.
You can use
mysql_query($q) or print("it's up the shoot, boss!");
but you can't use echo in that case either.
Maybe echo is the Michael Knight of PHP and can make a difference.
Ahh - print is now actually not a funciton, but a language construct.
echo is good because you can do things like
echo 'lovely', $i, ' super', $b, ' smashing<br/>'
;
which is quicker than using the dots for string concatenation, but you can't do that with print, maybe that's what's meddling with things.
EDIT #2: Straight from the manual
// Because echo is not a function, following code is invalid.
($some_var) ? echo('true'): echo('false');
// However, the following examples will work:
($some_var) ? print('true'): print('false'); // print is a function
echo $some_var ? 'true': 'false'; // changing the statement around
;
But it also says in the manual under print
print() is not actually a real function (it is a language construct) so you are not required to use parentheses with its argument list.
So I think this: just treat it like a weird friend who you love, even though they're a complete freak.