diff options
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 1d18b047d3..14075847ad 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2056,7 +2056,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio int count=0, unload=0; HashTable *target_function_table = function_table; int error_type; - zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__unset = NULL, *__isset = NULL, *__call = NULL, *__callstatic = NULL, *__tostring = NULL, *__debugInfo = NULL, *serialize_func = NULL, *unserialize_func = NULL; + zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__unset = NULL, *__isset = NULL, *__call = NULL, *__callstatic = NULL, *__tostring = NULL, *__debugInfo = NULL, *__serialize = NULL, *__unserialize = NULL; zend_string *lowercase_name; size_t fname_len; const char *lc_class_name = NULL; @@ -2222,11 +2222,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio if (scope) { /* Look for ctor, dtor, clone */ - if (zend_string_equals_literal(lowercase_name, "serialize")) { - serialize_func = reg_function; - } else if (zend_string_equals_literal(lowercase_name, "unserialize")) { - unserialize_func = reg_function; - } else if (ZSTR_VAL(lowercase_name)[0] != '_' || ZSTR_VAL(lowercase_name)[1] != '_') { + if (ZSTR_VAL(lowercase_name)[0] != '_' || ZSTR_VAL(lowercase_name)[1] != '_') { reg_function = NULL; } else if (zend_string_equals_literal(lowercase_name, ZEND_CONSTRUCTOR_FUNC_NAME)) { ctor = reg_function; @@ -2257,6 +2253,10 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio scope->ce_flags |= ZEND_ACC_USE_GUARDS; } else if (zend_string_equals_literal(lowercase_name, ZEND_DEBUGINFO_FUNC_NAME)) { __debugInfo = reg_function; + } else if (zend_string_equals_literal(lowercase_name, "__serialize")) { + __serialize = reg_function; + } else if (zend_string_equals_literal(lowercase_name, "__unserialize")) { + __unserialize = reg_function; } else { reg_function = NULL; } @@ -2298,8 +2298,8 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio scope->__unset = __unset; scope->__isset = __isset; scope->__debugInfo = __debugInfo; - scope->serialize_func = serialize_func; - scope->unserialize_func = unserialize_func; + scope->__serialize = __serialize; + scope->__unserialize = __unserialize; if (ctor) { ctor->common.fn_flags |= ZEND_ACC_CTOR; if (ctor->common.fn_flags & ZEND_ACC_STATIC) { |