直接代码:
class father{
public function test(){
echo "father";
}
public function test1(){
echo "test";
}
}
class son extends father{
public function test($name){//方法重载
parent::test();//还想要这父类的东西
echo "son ",$name;
}
public function test1(){//方法重写
echo "this is test";
}
}
// $son = new son();
// $son->test("XXX");
// $son->test1();