Category Archives: PHP

Enum in PHP

Although the concept of enums is not novel in programming, PHP introduced this feature relatively recently, with its 8.1 version. Now, let’s explore the possibilities it offers. Enum in PHP is declared in this way: enum OrderStatus { case PENDING; case CONFIRMED; case SHIPPED; case DELIVERED; case CANCELLED; } So it represents a collection of…

Read More