Require ' ref.php ';
Class Sonref extends Ref {
Public $y =array (' A ', ' B ', ' C ');
Public function test ($STR) {
Print_r ($STR);
}
}
$k = new Sonref ();
$k->reftest ();
------Solution--------------------
Programs do not have a preference for sons. Sonref and Girlref both have a fair share of the non-private methods of the parent class.
------Solution--------------------
$fun = ' Test ';
$ss = ' $this->y ';
$funstr = ' $this '. $fun. ' ('. $ss. '); ';
eval ($FUNSTR);
Writing
$fun = ' Test ';
$this-$unn ($this->y);
------Solution--------------------
No matter who it originates from, since you can write $this->y then it means Y's already own.
I feel your train of thought is a bit messy, can you calm down to describe your needs carefully?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.