Help for this page

Select Code to Download


  1. or download this
    $a = 0;
    $b = 0;
    $c = $a++ && $b++;  # only $a++ is evaluated
    print "a = $a, b = $b\n";  # prints "a = 1, b = 0"
    
  2. or download this
    $a = 0;
    $b = 0;
    $c = ++$a || ++$b;  # only ++$a is evaluated
    print "a = $a, b = $b\n";  # prints "a = 1, b = 0"