From 808f8ed3060b2985cc9c067073c63c62c4613565 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Sun, 16 Jul 2000 16:40:21 +0000 Subject: [PATCH] Implement parent::foo() --- Zend/zend_compile.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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;