For example, you have the loop:
$i=0;
while($i<5) {
$x[$i] = $a[$i] + $b[$i];
$y[$i] = $x[$i] / $c[$i];
$i++;
}
Does this calculate faster than:
$i=0;
while($i<5) {
$x[$i] = $a[$i] + $b[$i];
$i++;
}
$i=0;
while($i<5) {
$y[$i] = $x[$i] / $c[$i];
$i++;
}
Or are they the same? I have absolutely no idea how exactly code is compiled or executes.
Thanks for the answers. I'm very new to programming so wasn't aware that it was possible to test the efficiency of code.