Mega Code Archive
The Method of a Child Class Overriding That of Its Parent (PHP 4 Syntax)
name = $name;
$this->code = $code;
}
function getName() {
return $this->name;
}
}
class PriceItem extends Item {
function getName() {
return "(price).".$this->name;
}
}
$item = new PriceItem( "widget", 5442 );
print $item->getName();
?>