Fixed behaviour of PHP current(...) builtin function with arrays during foreach loop

- Zend PHP behaviour has many other quirks (see http://stackoverflow.com/questions/10057671/how-foreach-actually-works#answer-14854568)
  but these are classed as "undefined behaviour"
Fixed failing test caused by handling of PHP foreach and internal array pointers