name = $name; $this->default = $default; self::$defaults[$name] = $this; } public function __toString(){ return $this->default; } public static function named(string $name){ if(!isset(self::$defaults[$name])){ throw new \Exception("DefaultValue {$name} not defined"); } return self::$defaults[$name]; } public static function add(string $name, string $default){ if(isset(self::$defaults[$name])){ throw new \Exception("DefaultValue {$name} already defined"); } return new DefaultValue($name, $default); } } DefaultValue::add('current_timestamp', 'current_timestamp'); ?>