in reply to if and else
Incidentally the built in trinary function does exactly what you are trying to do. The pattern for that looks like this:
So your intended behavior can be seen from:CONDITION ? do_if_true() : do_if_false();
Or more concisely with:0 ? print "TRUE" : print "FALSE";
print( 0 ? "TRUE" : "FALSE" );
|
|---|