Revision: 703
Updated Code
at August 1, 2006 02:00 by px
Updated Code
class SampleClass{ static private $instance = false; function getInstance(){ if (!self::$instance){ self::$instance = new SampleClass(); } return self::$instance; } } //Usage $SampleClassObject = SampleClass::getInstance();
Revision: 702
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at August 1, 2006 01:59 by px
Initial Code
<?php class SampleClass{ static private $instance = false; function getInstance(){ if (!self::$instance){ self::$instance = new SampleClass(); } return self::$instance; } } //Usage $SampleClassObject = SampleClass::getInstance(); ?>
Initial URL
http://simplex.pp.ru/tech/php/singleton
Initial Description
Initial Title
PHP5 Singleton pattern
Initial Tags
Initial Language
PHP