Implement parent::foo()

This commit is contained in:
Zeev Suraski 2000-07-16 16:40:21 +00:00
parent 7761580504
commit 808f8ed306

View File

@ -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;