All pastes #676177 Raw Edit

Untitled

public php v1 · immutable
#676177 ·published 2007-08-30 20:49 UTC
rendered paste body
<?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();?>