note 124229 deleted from language.operators.logical by cmb
| From: | cmb@php.net | Date: | Tue, 24 Sep 2019 08:42:56 +0000 |
| Subject: | note 124229 deleted from language.operators.logical by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212345@lists.php.net to get a copy of this message | ||
Note Submitter: Milan Branko
----
<?php
$var = 0;
// PHP will stop parsing the IF statement after the first value of the OR operation when the first
value of the OR operation is true:
if ($var1 = $var + 1 || $var2 = $var +2 ) {
echo "\$var1: ".$var1."<br>";
echo "\$var2: ".$var2;
}
// Output:
$var1: 1
$var2:
?>