Location: PHPKode > scripts > Namespaces > namespaces/test2.php
<?php
echo "<p>file test2.php was loaded</p>";
class test {
	private $obj;
	function test() {
		$this->obj= new test1();
		echo "<p>new object of class 'test' from file 'test2.php' created</p>";
	}
	public function sh() {
		$this->obj->show();
	}
}
class test1 {
	private $text;
	function test1(){
		$this->text= "<p>new object of class 'test1' from file 'test2.php' created</p>";
	}
	public function show() {
		echo  $this->text;
	}
}
?>
Return current item: Namespaces