This is not possible because static variables, well ... are STATIC and therefore cannot be declared dynamically.
EDIT: You might want to try using the registry.
class Registry { private static $instances = array(); public static function getInstance($class_name) { if(!isset(self::$instances[$class_name])) { self::$instances[$class_name] = new $class_name; } return self::$instances[$class_name]; } } Registry::getInstance('YourClass');
source share