I need to call a function getCount($stage)
multiple times (say 15, since $stage can have values from 0 to 14). Which method is faster:
for ($i=0; $i<15; $i++)
{
getCount($i);
}
OR
getCount(0);
getCount(1);
.
.
.
getCount(14);
?
The current page I'm working on has similar scenario. It uses the second method and it lacks readability. I'm looking forward to change it to the first method. Will there be any advantage or disadvantage in the aspect of runtime? Which method will be faster?