What\'s a nicer way to do the following, that doesn\'t call f() twice?
$x = f() ? f() : \'default\';
You could save it to a variable. Testcase:
function test() { echo 'here'; return 1; } $t = test(); $x = $t ? $t : 0; echo $x;