Skip to content

Commit 6720716

Browse files
committed
Optimize class lookup
1 parent 22d8393 commit 6720716

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Zend/zend_compile.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ void zend_do_early_binding(void) /* {{{ */
10291029
zend_class_entry *ce;
10301030

10311031
parent_name = CT_CONSTANT(fetch_class_opline->op2);
1032-
if (((ce = zend_lookup_class(Z_STR_P(parent_name))) == NULL) ||
1032+
if (((ce = zend_lookup_class_ex(Z_STR_P(parent_name), parent_name + 1, 0)) == NULL) ||
10331033
((CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_CLASSES) &&
10341034
(ce->type == ZEND_INTERNAL_CLASS))) {
10351035
if (CG(compiler_options) & ZEND_COMPILE_DELAYED_BINDING) {
@@ -1083,7 +1083,8 @@ ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array) /* {{
10831083

10841084
CG(in_compilation) = 1;
10851085
while (opline_num != (uint32_t)-1) {
1086-
if ((ce = zend_lookup_class(Z_STR_P(RT_CONSTANT(op_array, op_array->opcodes[opline_num-1].op2)))) != NULL) {
1086+
zval *parent_name = RT_CONSTANT(op_array, op_array->opcodes[opline_num-1].op2);
1087+
if ((ce = zend_lookup_class_ex(Z_STR_P(parent_name), parent_name + 1, 0)) != NULL) {
10871088
do_bind_inherited_class(op_array, &op_array->opcodes[opline_num], EG(class_table), ce, 0);
10881089
}
10891090
opline_num = op_array->opcodes[opline_num].result.opline_num;

0 commit comments

Comments
 (0)