Is it possible to be able to dynamically set a php static class variable? In the example below i want to pass a string representation of the variable i want to set to a function "databaseInit" which then sets the var...
class app {
static $database_smf;
static $database_phpbb;
/**
* Initialise the app
*/
static function init(){
// No initialise the db connection
self::databaseInit('database_phpbb');
self::databaseInit('database_smf');
}
static function databaseInit( $database ){
// is it possible to dynamically set the static var based on the param provided? eg:
self::[$database] = true;
}
}