Skip to content
Advertisement

Tag: instance

How to get instance of a specific class in PHP?

I need to check if there exists an instance of class_A ,and if there does exist, get that instance. How to do it in PHP? As always, I think a simple example is best. Now my problem has become: How to store the instance in a static member variable of class_A when instantiating? It’ll be better if the instance can

Advertisement