pdo_connect.php=================class PDOContainer{ public static $pdo = NULL; public function __construct() { if (!self::$pdo) { PDOContainer::$pdo = new PDO( 'mysql:host='.DB_HOST.';dbname='.DATABASE, DB_USER, DB_PASSWORD, Array(PDO::ATTR_PERSISTENT => TRUE)); } }} other_script.php==================require_once('pdo_connect.php');class SomeClass extends PDOContainer{ public function doSomething() { self::$pdo->prepare('SELECT * FROM my_table'); // they all share the same $pdo anyway }}The moment an object of class SomeClass is created, the PDOContainer::$pdo will be initialized