echo $this->DB->insert_id;
<?php class A { public $v = 12; } class B { public $a; public function __construct() { $this->a = new A(); } } $b = new B; echo $b->a->v;