Fixed for PHP ~5.4 upwards Zend API change

See: https://bugs.php.net/bug.php?id=65563

The extension can now be compiled in latest PHP versions. Tested up to 5.5.7