spam at afoyi dot com (21-Mar-2005 09:18)
You can call a function defined in an inherited class from the parent class. This works in both PHP 4.3.6 and 5.0.0: <?php class p { function p() { print "Parent's constructorn"; } function p_test() { print "p_test()n"; $this->c_test(); } } class c extends p { function c() { print "Child's constructorn"; parent::p(); } function c_test() { print "c_test()n"; } } $obj = new c; $obj 8/10 首页 上一页 6 7 8 9 10 下一页 尾页
8/10 首页 上一页 6 7 8 9 10 下一页 尾页