I've been working with 2 nested loops in PHP where the outer loop is executing over an array that has around 25K records and there is some processing that is being done in the inner loop for an array that has around 3000 records again.
The strange issue that I've found is when I use an echo statement in the outer loop, the script is terminating with expected result but without the echo statement, it keeps on processing and terminates after around 3 minutes without any result.
What can be the issue here?
Sample pseudo code:
for ($index = 0 ; $index <= 25,000 ; $index++)
{
for($indx = 0 ; $indx <= 3,000 ; $indx++)
{
//process logic
}
echo "Test Flow"; //with this, it works. Without it, enters infinite loop
}