Enum vs String as a parameter in a function

I think enums are safer especially for larger systems with multiple developers.

As soon as the need arises to change the value of such an enum, looking up and replacing a string in many places is not my idea of fun 🙂

The most important criteria IMHO is the usage: for use in a module or even a package a string seems to be fine, in a public API I’ld prefer enums.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)