As of PHP 7, offsetExists($offset) must return a TRUE value in order for offsetGet($offset) to be called, otherwise offsetGet($offset) will just return NULL. This was not the case in PHP 5, so if your code suddenly stops working upon upgrade to PHP 7, make sure offsetExists() returns sensible values.