mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Implement parent::foo()
This commit is contained in:
parent
7761580504
commit
808f8ed306
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user