We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

iloveitaly on 10/06/07


Tagged

Singleton Shared


Versions (?)


Shared/Singleton Objects


Published in: PHP 


  1. class PromotionManager {
  2. static $sharedInstance;
  3.  
  4. static function sharedManager () {
  5. if(!self::$sharedInstance) {
  6. self::$sharedInstance = new self();
  7. }
  8.  
  9. return self::$sharedInstance;
  10. }
  11.  
  12. function __construct() {
  13.  
  14. }
  15. }

Report this snippet 

You need to login to post a comment.