A "heterogeneous" syntax in PHP: $a && $b = $c;, PHP heterogeneous
A "heterogeneous" syntax in PHP: $a && $b = $c;
$a = 1;
$b = 2;
$c = 3;
$a && $b = $c;
echo "A: $a";
echo "B: $b";
echo "C: $c";
This is
A:1
B:3
C:3
$a = 0;
$b = 2;
$c = 3;
$a && $b = $c;
echo "A: $a";
echo "B: $b";
echo "C: $c";
This is
a:0
B:2
C:3 parsing: 1: The && and assignment operator "=" has a priority of && precedence, but accents is not written in $a and $b first and then = $c, so understanding is equivalent to 1= $c, and 1= $c This is the wrong 2: This alternative is correctly understood in the following way: if ($a) {$b = $c}, that is, if $ A is true, the assignment statement $b = $c is executed, otherwise the result is not difficult to understand
http://www.bkjia.com/PHPjc/1140578.html www.bkjia.com true http://www.bkjia.com/PHPjc/1140578.html techarticle a heterogeneous syntax in PHP: $a $b = $c, a "heterogeneous" syntax in PHP heterogeneous PHP: $a $b= $c; $a = 1; $b = 2; $c = 3; $a $b = $c; echo "A: $a"; echo "B: $b"; echo "C: $c"; This is a:1 b ...