When you have crap like this in your language:
> E.g., $i = 0; $a[$i] = $i++; makes a different array than $i = 0; $a[$i + 0] = $i++;
you have no hope of making a truly large program work. There are just too many sources of itsy bitsy bugs; you'll never find them all.
(I'm not a PHP user; I have no idea why those are different arrays. Don't bother explaining; I don't want to know.)