Created
May 26, 2024 16:02
-
-
Save bobmagicii/f3888f0032a2b2932b4571b23aac3204 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Container { | |
static protected | |
$Instance; | |
//////// | |
static public function | |
Init(?string $Input=NULL): | |
self { | |
if(!isset(self::$Instance)) | |
self::$Instance = self::New($Input); | |
return self::$Instance; | |
} | |
static public function | |
New(?string $Input=NULL): | |
self { | |
$Output = new self; | |
$Output->DoSomethingWithTheInputMaybe($Input); | |
return $Output; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment