In this intro episode, we set the stage for our journey into PHP enums. If enums sound totally new to you, don’t worry—this part is all about breaking down what enums actually are, why they’re useful, and what life was like in PHP before enums came along.
We dive into a simple, practical example: managing the status of a book (is it reading, want-to-read, or read?). First, we look at the typical approach—just using string values. Then, we improve things by creating a class with constants, which helps keep valid statuses in one place. Still, it’s clear that while this makes things a bit better, it’s not perfect and isn’t very flexible.
By the end, you’ll see exactly where enums fit in to solve these issues, and you'll be ready to build your first PHP enum in the next episode. Let’s go!