Fix PHP warnings ensure old/new values are always arrays

Fixes #663

@shadyvb Not much to see here, but please review.