<?php
interface printable {
public function printme();
}
abstractclass Number {
private $value;
abstractpublic function value();
public function reset() {
$this->value = NULL;
}
}
classIntegerextends Number implements printable {
private $value;
function __construct($value) {
$this->value = $value;
}
public function getValue() {
return (int)$this->value;
}
public function printme() {
echo (int)$this->value;
}
}
function printNumber(printable $myObject) {
$myObject->printme();
}
$inst = newInteger(10);
printNumber($inst);
?>