Help for this page

Select Code to Download


  1. or download this
    $a = 5;
    $b = 5;
    $c = 5;
    if ((($a == $b ) + ($a -1)) == $c) { print "yes!!!\n"; }
    
  2. or download this
    # given three equal 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