Hi!
Can anybody explain to me why this script outputs:
oneone
instead of:
zeroone
???????????
Thanks,
stefan
<?
class Cart {
var $items; // Items in our shopping cart
function add_item ($id,$text) {
$this->$items[$id] = $text;
}
function output($id){
echo $this->$items[$id];
}
}
$c = new Cart;
$c->add_item(0,"zero");
$c->add_item(1,"one");
$c->output(0);
$c->output(1);
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]