<?phpclass father{ //定义father类//定义protected成员方法protected function cook(){return 'protected cook';}protected function programme(){return 'protected programme';}protected function kung_fu(){return 'private kung fu';}}class son extends father{protected function cook(){ //重写父类的cook成员方法,访问控制符为protectedreturn 'protected cook';}public function programme(){ //重写父类的programme成员方法,访问控制符为publicreturn 'public programme';}private function kung_fu(){ //试图重写父类的kung_fu成员方法,访问控制符为privatereturn 'public kung_fu';}} ?>