There is no difference in itself, the habit problem, but sometimes the problem involving operator precedence, the results will be different, recorded.
For example:
Copy the Code code as follows:
$p = 6 or 0;
Var_dump ($p);//int (6)
$p = 6 | | 0;
Var_dump ($p);//bool (True)
$p = 6 and 0;
Var_dump ($p); Int (6)
$p = 6 && 0;
Var_dump ($p); BOOL (FALSE)
Because the assignment operation has a higher priority than the and and OR, the value is first assigned; more than && | | , so the logical operation Mr. Foo execution, the first logical operation, and then the assignment value.
http://www.bkjia.com/PHPjc/824937.html www.bkjia.com true http://www.bkjia.com/PHPjc/824937.html techarticle There is no difference in itself, the habit problem, but sometimes the problem involving operator precedence, the results will be different, recorded. For example: Copy code code as follows: $p = 6 or 0; Var_dump ...