$ cat test.php <? class MyClass { function MyClass () { echo "Hello\n"; } } class AnotherClass { var $my_class_ref; function AnotherClass() { $this->my_class_ref = new MyClass(); } } $another = new AnotherClass(); ?> $ php5 test.php Hello