id = $id; } function __destruct () { echo __CLASS__ . $this->id . getcwd() . ' -- '; } } Class B { function __construct () { $local = new A(':local:'); $GLOBALS['A'] = new A(':GLOBAL:'); } } new B(); ?>