The Need for Enums in PHP: Pre-8.1 Solutions
How we represent fixed value sets until PHP 8.1 brings native enums: class constants, a package and backed classes, and the trade-offs of each.
Category
Features, syntax and practices of the PHP, JavaScript, TypeScript, Go and Python languages, with release notes and worked examples. (Page 3/5)
This category has 50 posts.
How we represent fixed value sets until PHP 8.1 brings native enums: class constants, a package and backed classes, and the trade-offs of each.
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.
The practical case for moving repetitive transformation tasks to Python rather than PHP, with real script examples and what to watch for as a script grows.
A practical guide to PHP exceptions and error handling: try-catch-finally blocks, multiple catch clauses, custom exception classes, and global handlers.
I explore what you get — and what you don't — when building a small HTTP service with Go's net/http package, and where the framework threshold sits.
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 Go's concurrency model — goroutines and channels — and what changes when you come from PHP's process model.
My practical experience adopting TypeScript in a growing frontend codebase — what I gained, what I lost, and when it actually proved its worth.
I reinforced my newly learned Go by building a real CLI tool: what the language feels like in practice, and how far the standard library takes you.
A hands-on look at PHP 7.3's flexible heredoc syntax and list assignment improvements, and how they contribute to better code readability.
How async/await syntax replaced Promise chains and made asynchronous JavaScript genuinely readable, with examples on error handling and parallel calls.