PHP Singletons Wrapper (Dynamic Admin) I need to create an administration board that allows devs to create or modify options and display them in a panel. The Admin needs to be the same on each call made to it.
I've chosen to make all dependencies as singletons wrapped under Admin. This code only covers the approach, disconsider the lack of details.

class Admin {
    private static $instance;

    public static function getInstance() {
        if ( null === static::$instance ) {
            static::$instance = new static();
        }

        return static::$instance;
    }

    private function __clone() {

    }

    private function __wakeup() {

    }

    public $Options;
    public $Panel;

    protected function __construct() {
        $this-&gt;Options = Options::getInstance();
        $this-&gt;Panel = Panel::getInstance();
        $this-&gt;run();
    }

    protected function run() {
        $this-&gt;Panel-&gt;run();
    }
}

class Options {
    private static $instance;

    public static function getInstance() {
        if ( null === static::$instance ) {
            static::$instance = new static();
        }

        return static::$instance;
    }

    private function __clone() {

    }

    private function __wakeup() {

    }

    protected $options = array();

    public function getOptions() {
        return $this-&gt;options;
    }

    public function addOption($option) {
        $this-&gt;options[] = $option;
    }
}

class Panel {
    private static $instance;

    public static function getInstance() {
        if ( null === static::$instance ) {
            static::$instance = new static();
        }

        return static::$instance;
    }

    private function __clone() {

    }

    private function __wakeup() {

    }

    protected $title = 'Panel';

    public function run() {
        $this-&gt;render();
    }

    public function render() {
        $Options = Options::getInstance();
        $options = $Options-&gt;get_options();
        foreach($options as $option) {
            echo $option['name'];
        }
    }
}



$Admin = Admin::getInstance();
$Admin-&gt;Options-&gt;addOption( array( 'name' =&gt; 'Test' ) );
First, from a styling standpoint, your classes are structured strangely.  Typically, one would have all class properties defined as first thing in class, then the constructor as first method, then the other methods (oftentimes with public methods first with protected/private methods following).  Don't mix your properties throughout your class.



Be consistent with style around variable naming.  You probably should not be using first letter caps for any properties or variables in PHP (which is more or less industry standard).  See the PHP Standards Recommendations for good suggestions on standards to follow (particularly PSR-2 around coding style).



I have several concerns regarding class design:


I don't really understand need for singleton here.  I would actually suggest you consider dependency injection as a preferable way to inject dependencies into classes that need them.
It particularly doesn't seem to make sense to have late static binding in place like you do here if there is no intent to use inheritance.  Now if you had a Singleton base class from which you inherited singleton behavior for each of these classes, then use of late static binding might be appropriate.
Additionally, you make the options and panel properties on the Admin class mutable, so you are potentially allowing the caller to put the Admin class in a bad state.
I don't really even know why options are being held on Admin class at all.  Your dependency chain seems to be Options -&gt; Panel -&gt; Admin, so why put an Options dependency on Admin at all?
Why introduce run() alias to render() in Panel? This method adds nothing new.
I don't understand why you would call run() from Admin constructor when, in your usage example, you are adding options after the class is instantiated.  Would these options never be rendered?
I am  struggling to see the need for so much static/concrete duality across all these classes.  To me this could be greatly simplified using dependency injection with concrete implementations like shown below:


Example:

class Admin {
    // perhaps this should not really be public?
    // Do you really want this to be mutable outside the constructor
    public $panel;

    public function __construct(Panel $panel) {
        $this-&gt;panel = $panel;
    }

    protected function run() {
        $this-&gt;panel-&gt;render();
    }
}

class Options {
    protected $options = array();

    public function __construct() {}

    public function getOptions() {
        return $this-&gt;options;
    }

    public function addOption($option) {
        $this-&gt;options[] = $option;
    }
}

class Panel {
    protected $title = 'Panel';
    protected $optionContainer;

    public function __construct(Options $options) {
        $this-&gt;optionContainer = $options;
    }

    public function render() {
        $options = $this-&gt;optionContainer-&gt;get_options();
        foreach($options as $option) {
            echo $option['name'];
        }
    }
}

// usage
$options = new Options();
$options-&gt;addOption( array( 'name' =&gt; 'Test' ) );
$admin = new Admin(new Panel($options));
// maybe add more options
$admin-&gt;panel-&gt;options-&gt;addOptions( array( 'anotherName' =&gt; 'Another Test' ) 
$admin-&gt;run();