2017
03.24
03.24
I have tested a difference between these if statements:
$myVar = 'newVal';
if ($i % 2)
{
$myVar = 'oldVal';
}
if ($i % 2)
{
$myVar = 'oldVal';
}
else
{
$myVar = 'newVal';
}
$myVar = ($i % 2) ? 'oldVal' : 'newVal';
Winner: 2nd code.
Looser: 3rd one.
Test can be seen here