mardi 18 octobre 2016

PHP if execution

In PHP if you have the following code does $b get evaluated since $a will cause the if statement to return false?

$a = false;
$b = true;

if ($a && $b) {
  // more code here
}

also if $b does get evaluated are there ever circumstances where a portion of an if statement may not be evaluated as the processor already knows that the value to be false?

Aucun commentaire:

Enregistrer un commentaire