What does new self(); mean in PHP?
I've never seen code like this: public static function getInstance() { if ( ! isset(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; } Is it the same as new className() ? EDIT If the class is inheritant,which class does it point to? Pascal MARTIN self points to the class in which it is written. So, if your getInstance method is in a class name MyClass , the following line : self::$_instance = new self(); Will do the same as : self::$_instance = new MyClass(); Edit : a couple more informations, after the comments. If you have two classes that extend each other, you