fork(1) download
  1. <?php
  2.  
  3. for($i = 0; $i <= 1; $i++){
  4. for($j = 0; $j <= 1; $j++){
  5. for($k = 0; $k <= 1; $k++){
  6. $a = (bool) $i;
  7. $b = (bool) $j;
  8. $c = (bool) $k;
  9.  
  10. if ($a || $b and $c) {
  11. echo 'true ';
  12. } else {
  13. echo 'false';
  14. }
  15.  
  16. if ($a || $b && $c) {
  17. echo ' -> true ';
  18. } else {
  19. echo ' -> false';
  20. }
  21.  
  22. echo ' $a = ' . $i . ', $b = ' . $j . ', $c = ' . $k . PHP_EOL;
  23. }
  24. }
  25. }
Success #stdin #stdout 0.02s 23376KB
stdin
Standard input is empty
stdout
false -> false   $a = 0, $b = 0, $c = 0
false -> false   $a = 0, $b = 0, $c = 1
false -> false   $a = 0, $b = 1, $c = 0
true  -> true    $a = 0, $b = 1, $c = 1
false -> true    $a = 1, $b = 0, $c = 0
true  -> true    $a = 1, $b = 0, $c = 1
false -> true    $a = 1, $b = 1, $c = 0
true  -> true    $a = 1, $b = 1, $c = 1