The foreach method on array called the sub when the array is empty.
Test for foreach over empty array
There is a bug in which a the autoboxed foreach over an emtpy array
still calls the supplied sub once with undef.
Fixed foreach method
The foreach method called at least once in all cases, which is
wrong when the array is empty.