I was looking for info about singleton pattern, I found: http://www.php.net/manual/en/language.oop5.patterns.php#95196
I don't understand:
final static public function getInstance()
{
static $instance = null;
return $instance ?: $instance = new static;
}
If it set $instance to null, why this kind of return? Why do not create $instance in the global "space" of the class without set it to null in getInstance?