mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Cache __unserialize() instead of unserialize()
We should use these cache slots for the new object serialization mechanism rather than the old one.
This commit is contained in:
parent
b6deace022
commit
1314ccbf8c
11 changed files with 54 additions and 70 deletions
|
@ -167,15 +167,15 @@ static void do_inherit_parent_constructor(zend_class_entry *ce) /* {{{ */
|
|||
if (EXPECTED(!ce->clone)) {
|
||||
ce->clone = parent->clone;
|
||||
}
|
||||
if (EXPECTED(!ce->serialize_func)) {
|
||||
ce->serialize_func = parent->serialize_func;
|
||||
if (EXPECTED(!ce->__serialize)) {
|
||||
ce->__serialize = parent->__serialize;
|
||||
}
|
||||
if (EXPECTED(!ce->__unserialize)) {
|
||||
ce->__unserialize = parent->__unserialize;
|
||||
}
|
||||
if (EXPECTED(!ce->serialize)) {
|
||||
ce->serialize = parent->serialize;
|
||||
}
|
||||
if (EXPECTED(!ce->unserialize_func)) {
|
||||
ce->unserialize_func = parent->unserialize_func;
|
||||
}
|
||||
if (EXPECTED(!ce->unserialize)) {
|
||||
ce->unserialize = parent->unserialize;
|
||||
}
|
||||
|
@ -1557,11 +1557,7 @@ static void zend_do_implement_interfaces(zend_class_entry *ce, zend_class_entry
|
|||
|
||||
static void zend_add_magic_methods(zend_class_entry* ce, zend_string* mname, zend_function* fe) /* {{{ */
|
||||
{
|
||||
if (zend_string_equals_literal(mname, "serialize")) {
|
||||
ce->serialize_func = fe;
|
||||
} else if (zend_string_equals_literal(mname, "unserialize")) {
|
||||
ce->unserialize_func = fe;
|
||||
} else if (ZSTR_VAL(mname)[0] != '_' || ZSTR_VAL(mname)[1] != '_') {
|
||||
if (ZSTR_VAL(mname)[0] != '_' || ZSTR_VAL(mname)[1] != '_') {
|
||||
/* pass */
|
||||
} else if (zend_string_equals_literal(mname, ZEND_CLONE_FUNC_NAME)) {
|
||||
ce->clone = fe;
|
||||
|
@ -1589,6 +1585,10 @@ static void zend_add_magic_methods(zend_class_entry* ce, zend_string* mname, zen
|
|||
ce->__tostring = fe;
|
||||
} else if (zend_string_equals_literal(mname, ZEND_DEBUGINFO_FUNC_NAME)) {
|
||||
ce->__debugInfo = fe;
|
||||
} else if (zend_string_equals_literal(mname, "__serialize")) {
|
||||
ce->__serialize = fe;
|
||||
} else if (zend_string_equals_literal(mname, "__unserialize")) {
|
||||
ce->__unserialize = fe;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue