PHP问题,求解释


   
  $a=3;
  
$b=3;
if($a=5 || $b=5){
$a++;
$b++;
}
echo $a."<br/>".$b;

输出结果是1,4.请大神解释一下原因

编程语言 php

windk 10 years, 1 month ago

这个问题真实的进行的运算是
if($a=(5||$b)=5),这里5||$b为true直接进行运算。

itair answered 10 years, 1 month ago

Your Answer