Is there any sort of performance difference (speed or memory, especially) between the following two approaches?
$foo = false;
for ($i = 0; $i < 100; $i++) {
if ($i % 5 === 0) {
$foo = true;
}
}
vs.
$foo = false;
for ($i = 0; $i < 100; $i++) {
$foo = $i % 5 === 0;
}
This is an abstract example, but while I prefer the more succinct syntax of the latter, I'm unsure if constant assignment impacts performance?