in reply to Better expression for $x = !!$y||0
One way.
update:$x=$y?0:1 is correct as ambs mentioned.
Prasad