Since you don't like seeing the conditional operator in the if, why don't you move it to the outside?
$x = $y ? 1 : 0; if ($x) { ... }
It has the added advantage of removing an assignement from an if's condition, something I find quite unnatural and unreadable.
In reply to Re^3: Better expression for $x = !!$y||0
by ikegami
in thread Better expression for $x = !!$y||0
by borisz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |