Singleton.php 300 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 <?php Interface iSingleton { public static function make(); } abstract class Singleton implements iSingleton { public function __construct() { $ref = new ReflectionClass($this); throw new Exception($ref->getName() . ' is a singleton and can not be instantiated'); } } ?>