<?php
class Work{
	var $name = 'name';
	function getName(){
		return $this->name;
	}
}
class Worker{
	var $name = 'Ivan';
	var $work = null;
	function __construct($work){
		$this->work = $work;
	}
	function getWork(){
		return $this->work;
	}
}
$microsoft = new Work();
$ivan = new Worker($microsoft);

echo $ivan->getWork()->getName();
?>