diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-02-15 11:28:14 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-02-15 11:28:14 +0100 |
commit | 903821b1c7d6d4e8358608e19c6e47ce4c33ccb5 (patch) | |
tree | 9a18f6455e8d11110a7929a85602d4029ff99f8a /Zend/zend_API.c | |
parent | c3b63706a660ca3bf80fc7a062e21049f7b50a3c (diff) | |
parent | a2e953479857451640afa604a533ca177f2a9bf5 (diff) | |
download | php-git-903821b1c7d6d4e8358608e19c6e47ce4c33ccb5.tar.gz |
Merge branch 'PHP-7.4'
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index c03b6bfa5b..cd374383b1 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2072,7 +2072,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; + 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_string *lowercase_name; size_t fname_len; const char *lc_class_name = NULL; @@ -2242,7 +2242,11 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio if (scope) { /* Look for ctor, dtor, clone */ - if (ZSTR_VAL(lowercase_name)[0] != '_' || ZSTR_VAL(lowercase_name)[1] != '_') { + 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] != '_') { reg_function = NULL; } else if (zend_string_equals_literal(lowercase_name, ZEND_CONSTRUCTOR_FUNC_NAME)) { ctor = reg_function; @@ -2313,6 +2317,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; if (ctor) { ctor->common.fn_flags |= ZEND_ACC_CTOR; if (ctor->common.fn_flags & ZEND_ACC_STATIC) { |