diff options
Diffstat (limited to 'Zend/zend_compile.c')
| -rw-r--r-- | Zend/zend_compile.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index b169093de5..57ec932310 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5456,10 +5456,6 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */ op_array->required_num_args = i + 1; } - opline = zend_emit_op(NULL, opcode, NULL, &default_node); - SET_NODE(opline->result, &var_node); - opline->op1.num = i + 1; - arg_info = &arg_infos[i]; arg_info->name = zend_string_copy(name); arg_info->pass_by_reference = is_ref; @@ -5490,9 +5486,15 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */ zend_get_type_by_const(default_type), ZSTR_VAL(name), ZSTR_VAL(type_str)); } + } + opline = zend_emit_op(NULL, opcode, NULL, &default_node); + SET_NODE(opline->result, &var_node); + opline->op1.num = i + 1; + + if (type_ast) { /* Allocate cache slot to speed-up run-time class resolution */ - if (is_class) { + if (ZEND_TYPE_IS_CLASS(arg_info->type)) { opline->extended_value = zend_alloc_cache_slot(); } } |
