If you'll add a type cast in inddexing, your snippet will work (either of them): echo capital[ITALY.int]
And Byou can omit type in variable declaration altogether: var capital = ["Rome", "Berlin", "Lisbon"] But if the point is to just use explicit values for enum items, then you can add them to Araq's snippet. Then you don't need type casts using the variable.