<?php
class Cart {
var $items;
function add_item($artnr, $num) {
$this->items[$artnr] += $num;
}
}
?>
<?php
class NamedCart extends Cart {
var $owner;
function NamedCart($name) {
$this->owner = $name;
}
}
?>
<?php
$cart = new NamedCart("PenguinGear");
$cart->add_item(170923, 2);
?>
<?php
class foo {
function bar() {
echo "bar() called";
}
}
foo::bar();
?>