What does a class in his class method new itself represent? Is the constructor??
Reply to discussion (solution)
The new class name is used to create an instance of this class, which is the same everywhere, and there is no difference in usage
Your DB class declares a private constructor, so this DB class cannot be instantiated externally
So to write in the interior
Do you put the editor in a fancy, no-cost eye?
So the constructor is back in the past! Face this is more than face a white piece of black a lot of this is desktop background ... Sublimetext with plug-in transparent
This is your own new. You can also write new self like this. The landlord of this class is to achieve single-class use. You can only instantiate yourself.
Looks like a singleton pattern.
$instance is a static variable, getinstance is a static method
When this class is used outside, the object that is called directly by Db::getinstance is already new, and no matter how many times it is called, the same object is returned, guaranteeing that the object is a singleton
This is your own new. You can also write new self like this. The landlord of this class is to achieve single-class use. You can only instantiate yourself.
This avatar is very
hahaha I found that now a lot of developers are like to make the editor Holi fancy .... We are really old.
This is a singleton pattern.
hahaha I found that now a lot of developers are like to make the editor Holi fancy .... We are really old.
I'm sorry about the whole class.