Skip to content

Instantly share code, notes, and snippets.

@bobmagicii
Created May 26, 2024 16:02
Show Gist options
  • Save bobmagicii/f3888f0032a2b2932b4571b23aac3204 to your computer and use it in GitHub Desktop.
Save bobmagicii/f3888f0032a2b2932b4571b23aac3204 to your computer and use it in GitHub Desktop.
<?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