One of my colleagues was testing something and found out that a cron that was consuming 100% of memory and never ended. He is not a PHP Developer so he called me to take a look.
After less than a minute looking on the code I found the issue but I was perplexed to see how a code like that went to production.
In short this was the main execute code of the cron:
$row = array_shift($all);
As you can imagine, that array will never be empty, so the loop will never end.
Fixing it was very easy, a simple change from while to foreach took care of the issue, but a question remains for me: who tested this sh***
Obviously it wasn’t tested, otherwise this would have been caught way prior getting to production.
Sorry about my rant but I can’t avoid to get mad when I see a developer that did not even run the code prior commit it.