Talk in English - US at CascadiaPHP 2024
Track Name:
Crater Lake
View Slides: https://wkdb.yt/embracing-enums-slides
Checkout the code: https://wkdb.yt/enums
Short URL: https://joind.in/talk/1808a
(QR-Code (opens in new window))
In January 2020, I delivered a conference talk titled 'Enums: The Missing Data Type', which ended on a sour note: PHP probably would not have a native type for handling enumerations any time soon. To my surprise and delight, PHP 8.1 would release with a new 'Enum' type less than two years later. Now we can really explore enumerations: both the theory behind them and the current PHP implementation. We’ll cover how representing things like statuses with enums improves immutability, readability, and type safety; why limitations like not being able to extend enums are actually a good thing; and some tricks to get the most out of using enums in your code.
Comments
Please login to leave a comment