# given three equal variables if (($a == $b ) == ($b == $c)) { print "yes!!!\n"; } # as pointed out by Sidhekin # given three different variables if (($a == $b ) == ($b == $c)) { print "yes!!!\n"; } # still prints 'yes!!!\n'. Why? # both sides evaluate to false or 0, # and 0 == 0 evaluates to true