In PHP you can call a class\'s static method from an object instance (which is contained in an array) like this:
$myArray[\'instanceOfMyClass\']::staticMetho
This is a really interesting problem, it may even be a bug in PHP itself.
For a work around, use the KISS principle.
class RunCode
{
private $myArray;
public function __construct(){
$this->myArray = array();
$this->myArray['instanceOfMyClass'] = new MyClass;
$instance = $this->myArray['instanceOfMyClass']
$instance::staticMethod();
}
}
Hope this helps!