Skip to content

Instantly share code, notes, and snippets.

@axxapy
Created April 25, 2015 07:34
Show Gist options
  • Save axxapy/a2bcc7e508a03a0d674a to your computer and use it in GitHub Desktop.
Save axxapy/a2bcc7e508a03a0d674a to your computer and use it in GitHub Desktop.
runkit php 5.6 fix
diff --git a/runkit_import.c b/runkit_import.c
index e3bc1f7..d7ab65f 100644
--- a/runkit_import.c
+++ b/runkit_import.c
@@ -217,13 +217,13 @@ static int php_runkit_import_class_consts(zend_class_entry *dce, zend_class_entr
}
}
if (
- Z_TYPE_PP(c) == IS_CONSTANT_ARRAY
+ Z_TYPE_PP(c) == IS_CONSTANT_AST
#if RUNKIT_ABOVE53
|| (Z_TYPE_PP(c) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT
#endif
) {
#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 2 || PHP_MAJOR_VERSION > 5
- zval_update_constant_ex(c, (void*) 1, dce TSRMLS_CC);
+ zval_update_constant_ex(c, 1, dce TSRMLS_CC);
#else
zval_update_constant(c, dce TSRMLS_CC);
#endif
@@ -268,13 +268,13 @@ static int php_runkit_import_class_static_props(zend_class_entry *dce, zend_clas
#else
zend_hash_quick_find(CE_STATIC_MEMBERS(ce), property_info_ptr->name, property_info_ptr->name_length + 1, property_info_ptr->h, (void*) &pp);
if (
- Z_TYPE_PP(pp) == IS_CONSTANT_ARRAY
+ Z_TYPE_PP(pp) == IS_CONSTANT_AST
#if RUNKIT_ABOVE53
|| (Z_TYPE_PP(pp) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT
#endif // RUNKIT_ABOVE53
) {
#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 2 || PHP_MAJOR_VERSION > 5
- zval_update_constant_ex(pp, (void*) 1, dce TSRMLS_CC);
+ zval_update_constant_ex(pp, 1, dce TSRMLS_CC);
#else
zval_update_constant(pp, dce TSRMLS_CC);
#endif
@@ -286,7 +286,7 @@ static int php_runkit_import_class_static_props(zend_class_entry *dce, zend_clas
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to import %s::$%s (cannot remove old member)", dce->name, key);
goto import_st_prop_skip;
}
- zval_update_constant(pp, dce TSRMLS_CC);
+ zval_update_constant(pp, (long) dce TSRMLS_CC);
if (php_runkit_def_prop_add_int(dce, key, key_len - 1, *pp, property_info_ptr->flags,
property_info_ptr->doc_comment,
property_info_ptr->doc_comment_len, dce,
@@ -354,13 +354,13 @@ static int php_runkit_import_class_props(zend_class_entry *dce, zend_class_entry
}
#endif // (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4) || (PHP_MAJOR_VERSION > 5)
if (
- Z_TYPE_PP(p) == IS_CONSTANT_ARRAY
+ Z_TYPE_PP(p) == IS_CONSTANT_AST
#if RUNKIT_ABOVE53
|| (Z_TYPE_PP(p) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT
#endif // RUNKIT_ABOVE53
) {
#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 2 || PHP_MAJOR_VERSION > 5
- zval_update_constant_ex(p, (void*) 1, dce TSRMLS_CC);
+ zval_update_constant_ex(p, 1, dce TSRMLS_CC);
#else
zval_update_constant(p, dce TSRMLS_CC);
#endif
diff --git a/runkit_props.c b/runkit_props.c
index be6c92f..eed291a 100644
--- a/runkit_props.c
+++ b/runkit_props.c
@@ -499,13 +499,13 @@ static int php_runkit_def_prop_add(char *classname, int classname_len, char *pro
return FAILURE;
}
if (
- Z_TYPE_P(copyval) == IS_CONSTANT_ARRAY
+ Z_TYPE_P(copyval) == IS_CONSTANT_AST
# if RUNKIT_ABOVE53
|| (Z_TYPE_P(copyval) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT
# endif
) {
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 2) || (PHP_MAJOR_VERSION > 5)
- zval_update_constant_ex(&copyval, (void*) 1, ce TSRMLS_CC);
+ zval_update_constant_ex(&copyval, 1, ce TSRMLS_CC);
#else
zval_update_constant(&copyval, ce TSRMLS_CC);
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment