PHP 5.4 compatibility fix

* See https://bugs.php.net/bug.php?id=61276 for more
information