Skip to content

Commit

Permalink
Implement parent::foo()
Browse files Browse the repository at this point in the history
  • Loading branch information
zsuraski committed Jul 16, 2000
1 parent 7761580 commit 808f8ed
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 808f8ed

Please sign in to comment.