Answer the question
In order to leave comments, you need to log in
How to remove a static instance of a class in PHP?
How to remove a static instance of a class? I create it like this
<?php
class MyClass
{
protected static $myclass;
public static function instanceClass()
{
if (is_null(self::$myclass)) {
self::$myclass= new self;
}
return self::$myclass;
}
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