class DB { function DB() {} } class Test { var $db; function Test() { $this->db = $_GLOBALS['dbConn']; } } $dbConn = new DB(); $test = new Test();
half the post seems to be missing, if the rest of it was there we might be able to work out what you want.
Looks like bad form to be in any case, using globals like that.
Erm, yeah....
Just wanted to assign $this->db with the global variable of the DB object. Need to know if its possible, not if its bad or good. I don't plan on using it like this, this was just an example to find out if I can do what I want.