The release of PHP 8.1 will be here within a few months, and once again there are many features that get me excited! In this post I want to share the real-life impact that PHP 8.1 will have on my own code.
A long-awaited feature, enums are coming! There's little to be said about this one, besides that I'm looking forward to not having to use spatie/enum or myclabs/php-enum anymore. Thanks for all the years of enum support to those packages, but they are the first I'll ditch when PHP 8.1 arrives and when I change this:
This one might seem like a small one, but it has bothered me more than once: only list arrays could be unpacked before PHP 8.1:
And so, one of the great features of PHP 8.1 that will make my life easier, is that arrays with string keys can now be unpacked as well!
Noticed a tpyo? You can submit a PR to fix it. If you want to stay up to date about what's happening on this blog, you can follow me on Twitter or subscribe to my newsletter: Email Subscribe