Need help with converting PHP5 class code to PHP4

I’m not a programmer but a job at hand requires me to build something like a shopping cart with Ajax so I read some tutorials and got my hands dirty with Prototype.

Nothing wrong with the JS but the PHP that is returning the results seems to be written in PHP5 so it doesn’t work on my server (which has PHP4).

<?php
session_start();

class Shopping_Cart {

    private $cart;

    function __construct($cart="") {
        $this->cart = $cart;
    }

    function getCart() {
        return $this->cart;
    }
   
    function addToCart($item) {
        if(isset($this->cart[$item])) {
            $this->cart[$item]++;
        } else {
            $this->cart[$item] = 1;
        }      
    }

    function deleteFromCart($item) {
        if(isset($this->cart[$item])) {
            $this->cart[$item]--;
            if($this->cart[$item] == 0) {
                unset($this->cart[$item]);
            }
        }
    }
   
}

$items = $_SESSION["cart"];

// Retrieve the parameters
$task = $_GET['task'];
$item = $_GET['item'];

if ($task == "add") {

   $cart->addToCart($item);
   $_SESSION["cart"] = $cart->getCart();
   echo "item added!";
   
} else {

   $cart->deleteFromCart($item);
   echo "item deleted!";
   
}
?>

The error displayed:

Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /pathtomyscript/managecart.php on line 6

Line 6 is where it says [COLOR=“RoyalBlue”]private $cart[/COLOR]

I hope someone can be kind enough to show me how to turn the class into PHP4 code.