diff options
Diffstat (limited to 'Zend/zend_interfaces.c')
-rw-r--r-- | Zend/zend_interfaces.c | 268 |
1 files changed, 138 insertions, 130 deletions
diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index 7f57a6abdd..28f651cc85 100644 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -5,7 +5,7 @@ | Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | + | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.zend.com/license/2_00.txt. | | If you did not receive a copy of the Zend license and are unable to | @@ -31,24 +31,27 @@ ZEND_API zend_class_entry *zend_ce_serializable; /* {{{ zend_call_method Only returns the returned zval if retval_ptr != NULL */ -ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC) +ZEND_API zval* zend_call_method(zval *object, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, size_t function_name_len, zval *retval_ptr, int param_count, zval* arg1, zval* arg2) { int result; zend_fcall_info fci; - zval z_fname; - zval *retval; + zval retval; HashTable *function_table; - zval **params[2]; + zval params[2]; - params[0] = &arg1; - params[1] = &arg2; + if (param_count > 0) { + ZVAL_COPY_VALUE(¶ms[0], arg1); + } + if (param_count > 1) { + ZVAL_COPY_VALUE(¶ms[1], arg2); + } fci.size = sizeof(fci); /*fci.function_table = NULL; will be read form zend_class_entry of object if needed */ - fci.object_ptr = object_pp ? *object_pp : NULL; - fci.function_name = &z_fname; - fci.retval_ptr_ptr = retval_ptr_ptr ? retval_ptr_ptr : &retval; + fci.object = (object && Z_TYPE_P(object) == IS_OBJECT) ? Z_OBJ_P(object) : NULL; + ZVAL_STRINGL(&fci.function_name, function_name, function_name_len); + fci.retval = retval_ptr ? retval_ptr : &retval; fci.param_count = param_count; fci.params = params; fci.no_separation = 1; @@ -57,15 +60,15 @@ ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend if (!fn_proxy && !obj_ce) { /* no interest in caching and no information already present that is * needed later inside zend_call_function. */ - ZVAL_STRINGL(&z_fname, function_name, function_name_len, 0); - fci.function_table = !object_pp ? EG(function_table) : NULL; - result = zend_call_function(&fci, NULL TSRMLS_CC); + fci.function_table = !object ? EG(function_table) : NULL; + result = zend_call_function(&fci, NULL); + zval_ptr_dtor(&fci.function_name); } else { zend_fcall_info_cache fcic; fcic.initialized = 1; if (!obj_ce) { - obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL; + obj_ce = object ? Z_OBJCE_P(object) : NULL; } if (obj_ce) { function_table = &obj_ce->function_table; @@ -73,9 +76,9 @@ ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend function_table = EG(function_table); } if (!fn_proxy || !*fn_proxy) { - if (zend_hash_find(function_table, function_name, function_name_len+1, (void **) &fcic.function_handler) == FAILURE) { + if ((fcic.function_handler = zend_hash_find_ptr(function_table, Z_STR(fci.function_name))) == NULL) { /* error at c-level */ - zend_error(E_CORE_ERROR, "Couldn't find implementation for method %s%s%s", obj_ce ? obj_ce->name : "", obj_ce ? "::" : "", function_name); + zend_error_noreturn(E_CORE_ERROR, "Couldn't find implementation for method %s%s%s", obj_ce ? obj_ce->name->val : "", obj_ce ? "::" : "", function_name); } if (fn_proxy) { *fn_proxy = fcic.function_handler; @@ -84,85 +87,88 @@ ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend fcic.function_handler = *fn_proxy; } fcic.calling_scope = obj_ce; - if (object_pp) { - fcic.called_scope = Z_OBJCE_PP(object_pp); + if (object) { + fcic.called_scope = Z_OBJCE_P(object); } else if (obj_ce && - !(EG(called_scope) && - instanceof_function(EG(called_scope), obj_ce TSRMLS_CC))) { + !(EG(current_execute_data) && + EG(current_execute_data)->called_scope && + instanceof_function(EG(current_execute_data)->called_scope, obj_ce))) { fcic.called_scope = obj_ce; } else { - fcic.called_scope = EG(called_scope); + fcic.called_scope = EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL; } - fcic.object_ptr = object_pp ? *object_pp : NULL; - result = zend_call_function(&fci, &fcic TSRMLS_CC); + fcic.object = object ? Z_OBJ_P(object) : NULL; + result = zend_call_function(&fci, &fcic); + zval_ptr_dtor(&fci.function_name); } if (result == FAILURE) { /* error at c-level */ if (!obj_ce) { - obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL; + obj_ce = object ? Z_OBJCE_P(object) : NULL; } if (!EG(exception)) { - zend_error(E_CORE_ERROR, "Couldn't execute method %s%s%s", obj_ce ? obj_ce->name : "", obj_ce ? "::" : "", function_name); + zend_error_noreturn(E_CORE_ERROR, "Couldn't execute method %s%s%s", obj_ce ? obj_ce->name->val : "", obj_ce ? "::" : "", function_name); } } - if (!retval_ptr_ptr) { - if (retval) { - zval_ptr_dtor(&retval); - } + /* copy arguments back, they might be changed by references */ + if (param_count > 0 && Z_ISREF(params[0]) && !Z_ISREF_P(arg1)) { + ZVAL_COPY_VALUE(arg1, ¶ms[0]); + } + if (param_count > 1 && Z_ISREF(params[1]) && !Z_ISREF_P(arg2)) { + ZVAL_COPY_VALUE(arg2, ¶ms[1]); + } + if (!retval_ptr) { + zval_ptr_dtor(&retval); return NULL; } - return *retval_ptr_ptr; + return retval_ptr; } /* }}} */ /* iterator interface, c-level functions used by engine */ /* {{{ zend_user_it_new_iterator */ -ZEND_API zval *zend_user_it_new_iterator(zend_class_entry *ce, zval *object TSRMLS_DC) +ZEND_API void zend_user_it_new_iterator(zend_class_entry *ce, zval *object, zval *retval) { - zval *retval; - - return zend_call_method_with_0_params(&object, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", &retval); - + zend_call_method_with_0_params(object, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", retval); } /* }}} */ /* {{{ zend_user_it_invalidate_current */ -ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC) +ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter) { zend_user_iterator *iter = (zend_user_iterator*)_iter; - if (iter->value) { + if (!Z_ISUNDEF(iter->value)) { zval_ptr_dtor(&iter->value); - iter->value = NULL; + ZVAL_UNDEF(&iter->value); } } /* }}} */ /* {{{ zend_user_it_dtor */ -static void zend_user_it_dtor(zend_object_iterator *_iter TSRMLS_DC) +static void zend_user_it_dtor(zend_object_iterator *_iter) { zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; + zval *object = &iter->it.data; - zend_user_it_invalidate_current(_iter TSRMLS_CC); - zval_ptr_dtor(&object); - efree(iter); + zend_user_it_invalidate_current(_iter); + zval_ptr_dtor(object); } /* }}} */ /* {{{ zend_user_it_valid */ -ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC) +ZEND_API int zend_user_it_valid(zend_object_iterator *_iter) { if (_iter) { zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - zval *more; + zval *object = &iter->it.data; + zval more; int result; - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_valid, "valid", &more); - if (more) { - result = i_zend_is_true(more); + zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_valid, "valid", &more); + if (Z_TYPE(more) != IS_UNDEF) { + result = i_zend_is_true(&more); zval_ptr_dtor(&more); return result ? SUCCESS : FAILURE; } @@ -172,21 +178,21 @@ ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC) /* }}} */ /* {{{ zend_user_it_get_current_data */ -ZEND_API void zend_user_it_get_current_data(zend_object_iterator *_iter, zval ***data TSRMLS_DC) +ZEND_API zval *zend_user_it_get_current_data(zend_object_iterator *_iter) { zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; + zval *object = &iter->it.data; - if (!iter->value) { - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_current, "current", &iter->value); + if (Z_ISUNDEF(iter->value)) { + zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_current, "current", &iter->value); } - *data = &iter->value; + return &iter->value; } /* }}} */ /* {{{ zend_user_it_get_current_key_default */ #if 0 -static int zend_user_it_get_current_key_default(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) +static int zend_user_it_get_current_key_default(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key) { *int_key = _iter->index; return HASH_KEY_IS_LONG; @@ -195,44 +201,45 @@ static int zend_user_it_get_current_key_default(zend_object_iterator *_iter, cha /* }}} */ /* {{{ zend_user_it_get_current_key */ -ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *key TSRMLS_DC) +ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *key) { zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - zval *retval; + zval *object = &iter->it.data; + zval retval; - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_key, "key", &retval); + zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_key, "key", &retval); - if (retval) { - ZVAL_ZVAL(key, retval, 1, 1); + if (Z_TYPE(retval) != IS_UNDEF) { + ZVAL_ZVAL(key, &retval, 1, 1); } else { if (!EG(exception)) { - zend_error(E_WARNING, "Nothing returned from %s::key()", iter->ce->name); + zend_error(E_WARNING, "Nothing returned from %s::key()", iter->ce->name->val); } ZVAL_LONG(key, 0); } } +/* }}} */ /* {{{ zend_user_it_move_forward */ -ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC) +ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter) { zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; + zval *object = &iter->it.data; - zend_user_it_invalidate_current(_iter TSRMLS_CC); - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_next, "next", NULL); + zend_user_it_invalidate_current(_iter); + zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_next, "next", NULL); } /* }}} */ /* {{{ zend_user_it_rewind */ -ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter TSRMLS_DC) +ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter) { zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; + zval *object = &iter->it.data; - zend_user_it_invalidate_current(_iter TSRMLS_CC); - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_rewind, "rewind", NULL); + zend_user_it_invalidate_current(_iter); + zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_rewind, "rewind", NULL); } /* }}} */ @@ -247,54 +254,55 @@ zend_object_iterator_funcs zend_interface_iterator_funcs_iterator = { }; /* {{{ zend_user_it_get_iterator */ -static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) +static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zval *object, int by_ref) { zend_user_iterator *iterator; if (by_ref) { - zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); + zend_error_noreturn(E_ERROR, "An iterator cannot be used with foreach by reference"); } iterator = emalloc(sizeof(zend_user_iterator)); - Z_ADDREF_P(object); - iterator->it.data = (void*)object; + zend_iterator_init((zend_object_iterator*)iterator); + + ZVAL_COPY(&iterator->it.data, object); iterator->it.funcs = ce->iterator_funcs.funcs; iterator->ce = Z_OBJCE_P(object); - iterator->value = NULL; + ZVAL_UNDEF(&iterator->value); return (zend_object_iterator*)iterator; } /* }}} */ /* {{{ zend_user_it_get_new_iterator */ -ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) +ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object, int by_ref) { - zval *iterator = zend_user_it_new_iterator(ce, object TSRMLS_CC); + zval iterator; zend_object_iterator *new_iterator; + zend_class_entry *ce_it; - zend_class_entry *ce_it = iterator && Z_TYPE_P(iterator) == IS_OBJECT ? Z_OBJCE_P(iterator) : NULL; + zend_user_it_new_iterator(ce, object, &iterator); + ce_it = (Z_TYPE(iterator) == IS_OBJECT) ? Z_OBJCE(iterator) : NULL; - if (!ce_it || !ce_it->get_iterator || (ce_it->get_iterator == zend_user_it_get_new_iterator && iterator == object)) { + if (!ce_it || !ce_it->get_iterator || (ce_it->get_iterator == zend_user_it_get_new_iterator && Z_OBJ(iterator) == Z_OBJ_P(object))) { if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Objects returned by %s::getIterator() must be traversable or implement interface Iterator", ce ? ce->name : Z_OBJCE_P(object)->name); - } - if (iterator) { - zval_ptr_dtor(&iterator); + zend_throw_exception_ex(NULL, 0, "Objects returned by %s::getIterator() must be traversable or implement interface Iterator", ce ? ce->name->val : Z_OBJCE_P(object)->name->val); } + zval_ptr_dtor(&iterator); return NULL; } - new_iterator = ce_it->get_iterator(ce_it, iterator, by_ref TSRMLS_CC); + new_iterator = ce_it->get_iterator(ce_it, &iterator, by_ref); zval_ptr_dtor(&iterator); return new_iterator; } /* }}} */ /* {{{ zend_implement_traversable */ -static int zend_implement_traversable(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) +static int zend_implement_traversable(zend_class_entry *interface, zend_class_entry *class_type) { /* check that class_type is traversable at c-level or implements at least one of 'aggregate' and 'Iterator' */ - zend_uint i; + uint32_t i; if (class_type->get_iterator || (class_type->parent && class_type->parent->get_iterator)) { return SUCCESS; @@ -304,19 +312,20 @@ static int zend_implement_traversable(zend_class_entry *interface, zend_class_en return SUCCESS; } } - zend_error(E_CORE_ERROR, "Class %s must implement interface %s as part of either %s or %s", - class_type->name, - zend_ce_traversable->name, - zend_ce_iterator->name, - zend_ce_aggregate->name); + zend_error_noreturn(E_CORE_ERROR, "Class %s must implement interface %s as part of either %s or %s", + class_type->name->val, + zend_ce_traversable->name->val, + zend_ce_iterator->name->val, + zend_ce_aggregate->name->val); return FAILURE; } /* }}} */ /* {{{ zend_implement_aggregate */ -static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) +static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entry *class_type) { - int i, t = -1; + uint32_t i; + int t = -1; if (class_type->get_iterator) { if (class_type->type == ZEND_INTERNAL_CLASS) { @@ -327,10 +336,10 @@ static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entr if (class_type->num_interfaces) { for (i = 0; i < class_type->num_interfaces; i++) { if (class_type->interfaces[i] == zend_ce_iterator) { - zend_error(E_ERROR, "Class %s cannot implement both %s and %s at the same time", - class_type->name, - interface->name, - zend_ce_iterator->name); + zend_error_noreturn(E_ERROR, "Class %s cannot implement both %s and %s at the same time", + class_type->name->val, + interface->name->val, + zend_ce_iterator->name->val); return FAILURE; } if (class_type->interfaces[i] == zend_ce_traversable) { @@ -350,7 +359,7 @@ static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entr /* }}} */ /* {{{ zend_implement_iterator */ -static int zend_implement_iterator(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) +static int zend_implement_iterator(zend_class_entry *interface, zend_class_entry *class_type) { if (class_type->get_iterator && class_type->get_iterator != zend_user_it_get_iterator) { if (class_type->type == ZEND_INTERNAL_CLASS) { @@ -359,10 +368,10 @@ static int zend_implement_iterator(zend_class_entry *interface, zend_class_entry } else { /* c-level get_iterator cannot be changed */ if (class_type->get_iterator == zend_user_it_get_new_iterator) { - zend_error(E_ERROR, "Class %s cannot implement both %s and %s at the same time", - class_type->name, - interface->name, - zend_ce_aggregate->name); + zend_error_noreturn(E_ERROR, "Class %s cannot implement both %s and %s at the same time", + class_type->name->val, + interface->name->val, + zend_ce_aggregate->name->val); } return FAILURE; } @@ -381,7 +390,7 @@ static int zend_implement_iterator(zend_class_entry *interface, zend_class_entry /* }}} */ /* {{{ zend_implement_arrayaccess */ -static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) +static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_entry *class_type) { #if 0 /* get ht from ce */ @@ -397,26 +406,26 @@ static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_en /* }}}*/ /* {{{ zend_user_serialize */ -ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) +ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data) { zend_class_entry * ce = Z_OBJCE_P(object); - zval *retval; + zval retval; int result; - zend_call_method_with_0_params(&object, ce, &ce->serialize_func, "serialize", &retval); + zend_call_method_with_0_params(object, ce, &ce->serialize_func, "serialize", &retval); - if (!retval || EG(exception)) { + if (Z_TYPE(retval) == IS_UNDEF || EG(exception)) { result = FAILURE; } else { - switch(Z_TYPE_P(retval)) { + switch(Z_TYPE(retval)) { case IS_NULL: /* we could also make this '*buf_len = 0' but this allows to skip variables */ zval_ptr_dtor(&retval); return FAILURE; case IS_STRING: - *buffer = (unsigned char*)estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); - *buf_len = Z_STRLEN_P(retval); + *buffer = (unsigned char*)estrndup(Z_STRVAL(retval), Z_STRLEN(retval)); + *buf_len = Z_STRLEN(retval); result = SUCCESS; break; default: /* failure */ @@ -427,23 +436,22 @@ ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint } if (result == FAILURE && !EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "%s::serialize() must return a string or NULL", ce->name); + zend_throw_exception_ex(NULL, 0, "%s::serialize() must return a string or NULL", ce->name->val); } return result; } /* }}} */ /* {{{ zend_user_unserialize */ -ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) +ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data) { - zval * zdata; + zval zdata; - object_init_ex(*object, ce); + object_init_ex(object, ce); - MAKE_STD_ZVAL(zdata); - ZVAL_STRINGL(zdata, (char*)buf, buf_len, 1); + ZVAL_STRINGL(&zdata, (char*)buf, buf_len); - zend_call_method_with_1_params(object, ce, &ce->unserialize_func, "unserialize", NULL, zdata); + zend_call_method_with_1_params(object, ce, &ce->unserialize_func, "unserialize", NULL, &zdata); zval_ptr_dtor(&zdata); @@ -455,27 +463,27 @@ ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const un } /* }}} */ -ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */ +ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data) /* {{{ */ { zend_class_entry *ce = Z_OBJCE_P(object); - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Serialization of '%s' is not allowed", ce->name); + zend_throw_exception_ex(NULL, 0, "Serialization of '%s' is not allowed", ce->name->val); return FAILURE; } /* }}} */ -ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */ +ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data) /* {{{ */ { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Unserialization of '%s' is not allowed", ce->name); + zend_throw_exception_ex(NULL, 0, "Unserialization of '%s' is not allowed", ce->name->val); return FAILURE; } /* }}} */ /* {{{ zend_implement_serializable */ -static int zend_implement_serializable(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) +static int zend_implement_serializable(zend_class_entry *interface, zend_class_entry *class_type) { if (class_type->parent && (class_type->parent->serialize || class_type->parent->unserialize) - && !instanceof_function_ex(class_type->parent, zend_ce_serializable, 1 TSRMLS_CC)) { + && !instanceof_function_ex(class_type->parent, zend_ce_serializable, 1)) { return FAILURE; } if (!class_type->serialize) { @@ -491,7 +499,7 @@ static int zend_implement_serializable(zend_class_entry *interface, zend_class_e /* {{{ function tables */ const zend_function_entry zend_funcs_aggregate[] = { ZEND_ABSTRACT_ME(iterator, getIterator, NULL) - {NULL, NULL, NULL} + ZEND_FE_END }; const zend_function_entry zend_funcs_iterator[] = { @@ -500,7 +508,7 @@ const zend_function_entry zend_funcs_iterator[] = { ZEND_ABSTRACT_ME(iterator, key, NULL) ZEND_ABSTRACT_ME(iterator, valid, NULL) ZEND_ABSTRACT_ME(iterator, rewind, NULL) - {NULL, NULL, NULL} + ZEND_FE_END }; const zend_function_entry *zend_funcs_traversable = NULL; @@ -523,7 +531,7 @@ const zend_function_entry zend_funcs_arrayaccess[] = { ZEND_ABSTRACT_ME(arrayaccess, offsetGet, arginfo_arrayaccess_offset_get) ZEND_ABSTRACT_ME(arrayaccess, offsetSet, arginfo_arrayaccess_offset_value) ZEND_ABSTRACT_ME(arrayaccess, offsetUnset, arginfo_arrayaccess_offset) - {NULL, NULL, NULL} + ZEND_FE_END }; ZEND_BEGIN_ARG_INFO(arginfo_serializable_serialize, 0) @@ -533,7 +541,7 @@ ZEND_END_ARG_INFO() const zend_function_entry zend_funcs_serializable[] = { ZEND_ABSTRACT_ME(serializable, serialize, NULL) ZEND_FENTRY(unserialize, NULL, arginfo_serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT|ZEND_ACC_CTOR) - {NULL, NULL, NULL} + ZEND_FE_END }; /* }}} */ @@ -541,15 +549,15 @@ const zend_function_entry zend_funcs_serializable[] = { {\ zend_class_entry ce;\ INIT_CLASS_ENTRY(ce, # class_name_str, zend_funcs_ ## class_name) \ - zend_ce_ ## class_name = zend_register_internal_interface(&ce TSRMLS_CC);\ + zend_ce_ ## class_name = zend_register_internal_interface(&ce);\ zend_ce_ ## class_name->interface_gets_implemented = zend_implement_ ## class_name;\ } #define REGISTER_ITERATOR_IMPLEMENT(class_name, interface_name) \ - zend_class_implements(zend_ce_ ## class_name TSRMLS_CC, 1, zend_ce_ ## interface_name) + zend_class_implements(zend_ce_ ## class_name, 1, zend_ce_ ## interface_name) /* {{{ zend_register_interfaces */ -ZEND_API void zend_register_interfaces(TSRMLS_D) +ZEND_API void zend_register_interfaces(void) { REGISTER_ITERATOR_INTERFACE(traversable, Traversable); |