Answer the question
In order to leave comments, you need to log in
Why use such a construct in PHP?
class Class_Name {
private static $init;
public static function instance() {
if ( is_null( self::$init ) ) {
self::$init = new self();
}
return self::$init;
}
private __construct() {
}
}
Class_Name::instance();
new Class_Name();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question