diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 4e6567b4e63..2e9126a3d60 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -877,6 +877,15 @@ void do_begin_class_member_function_call(znode *class_name, znode *function_name opline->opcode = ZEND_INIT_FCALL_BY_NAME; zend_str_tolower(class_name->u.constant.value.str.val, class_name->u.constant.value.str.len); + if (class_name->u.constant.value.str.len==6 + && !memcmp(class_name->u.constant.value.str.val, "parent", 6)) { + if (!CG(active_class_entry) || !CG(active_class_entry)->parent) { + zend_error(E_COMPILE_ERROR, "No parent class available in this context"); + } + efree(class_name->u.constant.value.str.val); + class_name->u.constant.value.str.val = estrdup(CG(active_class_entry)->parent->name); + class_name->u.constant.value.str.len = CG(active_class_entry)->parent->name_length; + } opline->op1 = *class_name; opline->op2 = *function_name; opline->extended_value = ZEND_MEMBER_FUNC_CALL;