Why can\'t I do this in PHP? Where Database is a singleton class and getInstance() returns a PDO object.
You can't execute code to produce the value of a static variable as, by definition, static variables are affected at compile time, see :
Getting the run-time value of a variable, or calling a function (run-time too) can't be done at compile-time to they cannot be affected to static variables.