Accessing Classes Within Other Classes

I’m having an issue trying to use globals within classes, when I reference the settings class within the db class, my page doesn’t load. Here’s the code:

Initializing File (Includes all related files):

$settings = new Settings();
$db = new DB();


class Settings
	// Stuff...


class DB
	function __construct()
		// This causes the page to stop loading:
		global $settings;

		// Do stuff...

If anyone has any idea of what I’m trying to do, and more importantly a way to actually do it, any help would be greatly appreciated!

Sponsor our Newsletter | Privacy Policy | Terms of Service