Skip to content

Instantly share code, notes, and snippets.

@dshafik
Last active December 13, 2015 20:58
Show Gist options
  • Save dshafik/4973517 to your computer and use it in GitHub Desktop.
Save dshafik/4973517 to your computer and use it in GitHub Desktop.
diff --git a/runkit.c b/runkit.c
index 67c487b..4a15711 100644
--- a/runkit.c
+++ b/runkit.c
@@ -142,7 +142,7 @@ zend_module_entry runkit_module_entry = {
PHP_RSHUTDOWN(runkit),
PHP_MINFO(runkit),
#if ZEND_MODULE_API_NO >= 20010901
- PHP_RUNKIT_VERSION,
+ PHP_RUNKIT_VERSION,
#endif
STANDARD_MODULE_PROPERTIES
};
@@ -177,7 +177,7 @@ static void php_runkit_globals_ctor(zend_runkit_globals *runkit_global TSRMLS_DC
#define php_runkit_feature_constant(feature, enabled) \
_php_runkit_feature_constant("RUNKIT_FEATURE_" #feature, sizeof("RUNKIT_FEATURE_" #feature), (enabled), \
CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC)
-static void _php_runkit_feature_constant(const char *name, size_t name_len, zend_bool enabled,
+static void _php_runkit_feature_constant(const char *name, size_t name_len, zend_bool enabled,
int flags, int module_number TSRMLS_DC)
{
zend_constant c;
@@ -283,8 +283,11 @@ static void php_runkit_register_auto_global(char *s, int len TSRMLS_DC)
}
#ifdef ZEND_ENGINE_2
+#if PHP_MAJOR_VERSION > 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4)
+ if (zend_register_auto_global(s, len, 0, NULL TSRMLS_CC) == SUCCESS) {
+#else
if (zend_register_auto_global(s, len, NULL TSRMLS_CC) == SUCCESS) {
-
+#endif
/* This shouldn't be necessary, but it is */
zend_auto_global_disable_jit(s, len TSRMLS_CC);
#else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment