<?class Clase1{ private $obj; public function funcion() { $this->obj->metodo(); } public function __construct($aux) { if( !$aux ) { $this->obj = new Clase2(); } else { $this->obj = $aux; } }}?>