All pastes #962735 Raw Edit

I hate OO :(

public php v1 · immutable
#962735 ·published 2008-03-29 23:48 UTC
rendered paste body
<?PHPClass Cart {		private $ItemID;	private $Items as array;		function __construct($User)	{		$this->Username = $User;		$this->Items();		if ($User == 'none') {			$this->Expiry = 180;		}		else		{			$this->Expiry = 'never';		}	}		public function AddItem($ItemID, $Amount)	{			$this->Items[] = $ItemID;	}		public function ListItems()	{		$c == 0;		while ($Items[$c])		{					}	}		public function RemoveItem($itemID, $Amount)	{		$c = 0;		$found = 0;		while ($Items[$c]) {			if ($Items[$c] != $ItemID)			{				if ($found < $c) {					$found++;				}				$this->Items[] = $Items($c);			}			$c++;		}	}	}?>