PHP 4.0 Bug #5999: Problems with class
| From: | dfr at artelecom dot ru | Date: | Mon, 07 Aug 2000 05:14:21 +0000 |
| Subject: | PHP 4.0 Bug #5999: Problems with class | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-27989@lists.php.net to get a copy of this message | ||
From: dfr@artelecom.ru
Operating system: Windows 2000
PHP version: 4.0.0
PHP Bug Type: Scripting Engine problem
Bug description: Problems with class
Hello,
This code isn't work under PHP4:
<?
class Cart {
var $items;
function add_item($num) {
$this->items += $num;
}
function get_items() {
return $this->items;
}
}
$nnn = new Cart;
$nnn->add_item(10);
list($itm) = $nnn->get_items();
echo "Items: $itm<br>";
$nnn->add_item(100);
list($itm) = $nnn->get_items();
echo "Items: $itm<br>";
?>
I have nothing on output here