fork download
  1. <?php
  2. function subtracao($a, $b){
  3. if ($b > 0) return $a - $b;
  4. else return false;
  5. }
  6. if ($resultado = subtracao(4, 4)) echo "entrou";
  7. else echo "não entrou";
  8. if ($resultado = subtracao(4, 0)) echo "entrou";
  9. else echo "não entrou";
  10.  
  11. //https://pt.stackoverflow.com/q/392182/101
Success #stdin #stdout 0s 82560KB
stdin
Standard input is empty
stdout
não entrounão entrou