From 7657741997a7d8cf273fb5d981b46cca3a2bea25 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Tue, 25 Jun 2019 09:01:40 +0000 Subject: [PATCH 1/3] Update NEWS for PHP 7.4.0alpha2 --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index cfc7259cd94..e0626a17c30 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 7.4.0alpha2 +27 Jun 2019, PHP 7.4.0alpha2 - Core: . Fixed bug #78151 (Segfault caused by indirect expressions in PHP 7.4a1). From d8e6054f462ea1234899c6efea6b1593d249e05a Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Tue, 25 Jun 2019 09:03:00 +0000 Subject: [PATCH 2/3] Update NEWS for 7.4.0alpha3 --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index e0626a17c30..f2166f6c054 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +?? ??? ????, PHP 7.4.0alpha3 + + 27 Jun 2019, PHP 7.4.0alpha2 - Core: From bd0cb99d8c57f3f6b49abe4ccfdb2ef72ce3ab78 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 25 Jun 2019 12:41:06 +0300 Subject: [PATCH 3/3] Prevent useless hash lookups --- Zend/zend_inheritance.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index e107e851774..d4cd7084794 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -2404,14 +2404,17 @@ zend_bool zend_can_early_bind(zend_class_entry *ce, zend_class_entry *parent_ce) zend_function *parent_func; ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->function_table, key, parent_func) { uint32_t parent_flags = parent_func->common.fn_flags; - zend_function *func = zend_hash_find_ptr(&ce->function_table, key); + zval *zv; zend_string *unresolved_class; - if (!func || (parent_flags & ZEND_ACC_PRIVATE) || - ((parent_flags & ZEND_ACC_CTOR) && !(parent_flags & ZEND_ACC_ABSTRACT)) - ) { + + if ((parent_flags & ZEND_ACC_PRIVATE) || + ((parent_flags & ZEND_ACC_CTOR) && !(parent_flags & ZEND_ACC_ABSTRACT))) { continue; } - if (zend_do_perform_implementation_check(&unresolved_class, func, parent_func) == INHERITANCE_UNRESOLVED) { + + zv = zend_hash_find_ex(&ce->function_table, key, 1); + if (zv + && zend_do_perform_implementation_check(&unresolved_class, Z_FUNC_P(zv), parent_func) == INHERITANCE_UNRESOLVED) { return 0; } } ZEND_HASH_FOREACH_END();