Enum inheriting from int

According to the documentation:

Every enumeration type has an
underlying type, which can be any
integral type except char. The default
underlying type of the enumeration
elements is int.

So, no, you don’t need to use int. It would work with any integral type. If you don’t specify any it would use int as default and it’s this type that will be used to store the enumeration into memory.

Leave a Comment

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