com php-src: Optimisation: Zend/zend_execute.c

From: Date: Wed, 25 May 2016 16:24:11 +0000
Subject: com php-src: Optimisation: Zend/zend_execute.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-95512@lists.php.net to get a copy of this message
Commit: 56e2aaa11e8c13e95ddf6e1d7dfb9b1823c25c48 Author: Dmitry Stogov <dmitry@zend.com> Wed, 25 May 2016 19:24:11 +0300 Parents: 023df779628157bd07121fc05f9ee8763a7788ab Branches: typed_ref_properties Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=56e2aaa11e8c13e95ddf6e1d7dfb9b1823c25c48 Log: Optimisation Changed paths: M Zend/zend_execute.c Diff: diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 88e392d..81e2e98 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -815,11 +815,19 @@ static zend_always_inline zval* i_zend_verify_property_type(zend_property_info * if (EXPECTED(info->type == Z_TYPE_P(property))) { if (info->type_name) { if (!info->type_ce) { - zend_string *resolved = zend_resolve_property_type(info->type_name, info->ce); - - info->type_ce = zend_lookup_class(resolved); - if (!info->type_ce) { - return NULL; + if (zend_string_equals_literal_ci(info->type_name, "self")) { + info->type_ce = info->ce; + } else if (zend_string_equals_literal_ci(info->type_name, "parent")) { + if (UNEXPECTED(!info->ce->parent)) { + zend_throw_error(NULL, "Cannot access parent:: when current class scope has no parent"); + return NULL; + } + info->type_ce = info->ce->parent; + } else { + info->type_ce = zend_lookup_class(info->type_name); + if (!info->type_ce) { + return NULL; + } } }

« previous php.cvs (#95512) next »