<?php
require_once 'Product.php';
require_once 'CD.php';

// Import a namespace using the "use" statement
// use \parentnamespace\namespace as aliasname;
// Then the aliasname can be used to access classes from
// the namespace e.g.
// $obj = new aliasname\classname();
// e.g.
// use \Vehicles\Cars\SportsCars as NS; 
// $obj = new NS\Porche();
// A short hand exists
// use \Vehicles\Cars\SportsCars; implies use \Vehicles\Cars\SportsCars as SportsCars;
// $obj = new SportsCars\Porche();
// Can also import single classes in the same way
// use \Vehicles\Cars\SportsCars\Porche; 
// $obj = new Porche();

use \Main\Product\CD;		// Use namespace

$cds[] = new CD("Some CD", 2.99, "Some Artist", array("Track1", "Track2"));
$cds[] = new CD("Some CD2", 3.29, "Some Artist2", array("Track1", "Track2"));

foreach($cds as $cd)
{
	echo "CD is {$cd->Name}<br/>";
}

echo "Tax is {$cds[0]->CalculateTax()}";

?>