Untitled
public php v1 · immutable<?phpclass TestSingleton { private static $instance = null; private function __construct(){} public $crazy; function getInstance() { if ( self::$instance == null ) self::$instance = new TestSingleton(); return self::$instance; } function great(){ $crazy = "YesYes"; return $crazy; }}$a = TestSingleton::getInstance();$b = TestSingleton::getInstance();echo $a->great();echo $b->great();?>