Question: All the singleton patterns I have seen use a reference to the object to determine if the object has been instantiated. However, if I am using a singleton to guarantee only one db connection, why not use the db connection resource link to do this? Here is the code I am using. (PS: it works fine). I use the comment to be able to search for my classes easily. 

```
/*one*/

class one
  {
  public static $db;
  private function __construct()
    {
    self::$db=new mysqli(DB_HOST, DB_USER, DB_PASS, DB_DATABASE);
    }
  public static function get()
    {
    if(self::$db==NULL)
      {
      new self();
      }
    return self::$db;
    }
  }

```

Answer: 
Assuming I'm parsing your question correctly, you're asking if it's okay to use the nullity of `$db` to make sure that you only instantiate one; that's a perfectly valid way to do things, and in fact is what I would recommend. PHP `null` is explicitly intended to represent a variable with "no value" - a perfect fit for the uninitialized state of the singleton pattern.

Typically, these things will just be called by an intuitive name, e.g. `SomeAppDbConn`.
As Macmade already pointed out, the `constructor` method doesn't return anything but an instance of the class. Assuming you always want the same instance of `mysqli`, here's how I'd do it.

```
class DBInstance
{
    protected static $db;

    private function __construct()
    {
        // intentionally empty
    }

    public static function get()
    {
        if(self::$db === NULL)
        {
            self::$db=new mysqli(DB_HOST, DB_USER, DB_PASS, DB_DATABASE);
        }

        return self::$db;
    }
}

```

It most certainly is a singleton pattern with an added bonus of separating instantiation from the instantiated class.