I posted initially with casting (int) $i but I tested it without and it worked too.
In fact on my 64bit centos machine PHP 5.4 doesn't need the cast at all and the original code gives the correct result the first time as is.
I posted initially with casting (int) $i but I tested it without and it worked too.
In fact on my 64bit centos machine PHP 5.4 doesn't need the cast at all and the original code gives the correct result the first time as is.