"A", EnumInNestedNS::B=>"B", EnumInNestedNS::C=>"C", ); public static function Name($e) { if (!isset(self::$names[$e])) { throw new \Exception(); } return self::$names[$e]; } }