There's a logical operator for that: xor
can be written asif ( !$x == !$y) ) # bool($x) == bool($y) if ( !$x != !$y ) # bool($x) != bool($y)
if ( !($x xor $y) ) # bool($x) == bool($y) if ( $x xor $y ) # bool($x) != bool($y)
Unforunately, both sets have readability issues.
In reply to Re^5: Burned by precedence rules (== true)
by ikegami
in thread Burned by precedence rules
by vrk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |