If you do not want to create temporary variables, do the following:
while (current($data))
{
echo '<ATTR>',current($data), '</ATTR>', "\n";
next($data);
}
However, I do not know if this will really make it faster. They can only be said by the profiler, but this is such micro-optimization. I doubt you will notice the difference.
The best way to speed up the cycle is to use a faster computer.
source
share