<?php
// make sure it is broken
error_reporting(E_ALL);
abstract class media {
private $copyrightInfo;
abstract function play();
function setCopyrightInfo($info) {
$this->copyrightInfo = $info;
}
} // end of abstract class media
class cd extends media{
function play() {
echo "The CD has started playing!";
}
} // end class cd
$cd = new cd();
$cd->setCopyrightInfo("Copyrighted by who else? Me!");
$cd->play();
?>
Title:
Abstract Class Example
Description:
<?php // make sure it is broken error_reporting(E_ALL); abstract class media { private $copyrightInfo; abstract function play(); func...
...
Rating:
4