class Bird {
private $name;
private $breed;
private $price;
public function __construct($name, $breed, $price = 15) {
$this->setName ( $name );
$this->setBreed ( $breed );
$this->setPrice ( $price );
}
public function birdCall() {
printf ( "%s says: *chirp*
\n", $this->getName () );
}
public function display() {
printf ( "%s is a %s and costs \$%.2f.
", $this->getName (), $this->getBreed (), $this->getPrice () );
}
}
class Parrot extends Bird {
public function birdCall() {
printf ( "%s says: *squawk*
\n", $this->getName () );
}
public function __construct($name) {
parent::__construct ( $name, 'parrot', 25 );
}
public function curse() {
printf ( "%s
\n", $this->getName () );
}
}
?>