The Need for Enums in PHP: Pre-8.1 Solutions
How we represented fixed value sets before PHP 8.1 introduced native enums, and the trade-offs of each approach.
Tag
Building applications with PHP: language features, versions and practices. (Page 5/8)
There are 48 posts with this tag.
How we represented fixed value sets before PHP 8.1 introduced native enums, and the trade-offs of each approach.
PHP 8.0 is out. I share how I've been using attributes and the nullsafe operator in real projects, and what they've actually delivered.
PHP 8.0 isn't out yet, but the RFCs and beta releases are already readable. Here are my notes on three key features worth understanding before release.
A practical guide to PHP exceptions and error handling: try-catch-finally blocks, multiple catch clauses, custom exception classes, and global handlers.
PHP 7.4 was released in November 2019. Typed properties and arrow functions significantly strengthen the language's type system and syntax.
A hands-on look at PHP 7.3's flexible heredoc syntax and list assignment improvements, and how they contribute to better code readability.