All pastes #259893 Raw Edit

Unnamed

public text v1 · immutable
#259893 ·published 2006-11-27 21:07 UTC
rendered paste body
class foo {
    private static $_instance;
    public static function getInstance() {
        
        if (is_object(self::$_instance)) {
            return (self::$_instance);
        } else {
            return (self::$_instance = new self);
        }
    }
    private function __construct() {}
}