How to do Dynamic php Namespacing
<p>OK, Here is the actual issue broken down:</p>

<p>using namespacing:</p>

<pre><code> \home\Homecontroller::get(); // returns what I want
</code></pre>

<p>Without using namespacing:</p>

<pre><code>$str = "Homecontroller@get"
$caller = explode('@', $str);
$caller[0]::$caller[1](); // returns what I want
</code></pre>

<p>Every attempt to do this dynamically fails</p>

<pre><code>\$namespace\$caller[0]::$caller[1](); // fails
eval("\\${namespace}\\${caller[0]}::${caller[1]}()"); // fails
</code></pre>

<p>in the homecontroller.php file I have:</p>

<pre><code>&lt;?php
namespace home;
class Homecontroller {
    public function Homecontroller()
    {
        throw new Exception("Homecontroller is a static class");
    }
    public static function jsonify($data)
    {
        header('Cache-Control: no-cache, must-revalidate');
        header('Expires: Mon, 26 Jul 2016 05:00:00 GMT');
        header('Content-type: application/json');
        print json_encode ($data);
        exit();
    }
    public static function get()
    {
        $data = [];
        $data['message'] = "You have called the GET function";
        self::jsonify($data);
    }
}
</code></pre>

<p>I am building a framework that needs to respect the namespacing, but not specifically aware of them. I need to keep the namespaces listed in an external config file.</p>