Workaround for a segfault in older PHPs. (Credit: @ircmaxell)

See:

 * https://bugs.php.net/bug.php?id=63055
 * https://github.com/php/php-src/commit/e88cdaa0143aacd2d765eb0560452ea28e327e41