?php class Cart {var $items; / / Items in our shopping cart / / Add $num articles of $artnr to the cart function add_item ($artnr, $num) {$this - items[$artnr] += $num;} / / Take $num articles of $artnr out of the cart function remove_item ($artnr, $num) {if ($this - items[$artnr] $num) {$this - items[$artnr] -= $num; return true;} else {return false;}}}?
?php class Caddie {var $items; / / Eléments de notre panier / / Ajout de $num articles de type $artnr au panier function add_item ($artnr, $num) {$this - items[$artnr] += $num;} / / Suppression de $num articles du type $artnr du panier function remove_item ($artnr, $num) {if ($this - items[$artnr] $num) {$this - items[$artnr] -= $num; return TRUE;} else {return FALSE;}}}?