class CopyMe {}
$first = new CopyMe();
$second = $first;class Person
{
function getName() { return "Bob"; }
function getAge() { return 44; }
function __toString() {
$desc = $this->getName();
$desc .= " (age ".$this->getAge().")";
return $desc;
}
}
$person = new Person();
print $person;class Checkout
{
final function totalize()
{
// calculate bill
}
}
class IllegalCheckout extends Checkout
{
final function totalize()
{
// change bill calculation
}
}