the following two for loops perform differently.
for($i = 0,$j = 0;$i < 5 && $j < 5;$iPP,$jPP){
dump($i . "-" . $j);
}
echo "<hr>";
for($i = 0;$i < 5;$iPP){
for($j = 0;$j < 5;$jPP){
dump($i . "*" . $j);
}
}
result print:
string(3) "0-0"
string(3) "1-1"
string(3) "2-2"
string(3) "3-3"
string(3) "4-4"
-------------------------------------------------------------------------------------------
string(3) "0*0"
string(3) "0*1"
string(3) "0*2"
string(3) "0*3"
string(3) "0*4"
string(3) "1*0"
string(3) "1*1"
string(3) "1*2"
string(3) "1*3"
string(3) "1*4"
string(3) "2*0"
string(3) "2*1"
string(3) "2*2"
string(3) "2*3"
string(3) "2*4"
string(3) "3*0"
string(3) "3*1"
string(3) "3*2"
string(3) "3*3"
string(3) "3*4"
string(3) "4*0"
string(3) "4*1"
string(3) "4*2"
string(3) "4*3"
string(3) "4*4"
replace the & & in the first for loop with | | the printed result is the same. What"s the difference?
this way of writing is usually rarely used, and Baidu can"t find a reason, so I"m here to ask for advice.