classA{public$property="class A";publicfunctionshowProperty(){echo$this->property."<br>";}}classBextendsA// 클래스 A를 상속 받음.{public$property="class B";publicfunctionshowProperty()// 클래스 A의 메소드를 오버라이딩{echo"hello ".$this->property."<br>";}}$a=newA();$a->showProperty();// 클래스 A의 메소드 호출$b=newB();$b->showProperty();// 클래스 B의 메소드 호출