PHP’s latest and greatest version, PHP 8.1, has been released yesterday, i.e 25th November, 2021. So, I created this little page where I have covered all the articles on all the hot new features of PHP 8.1.
Intersection types in PHP 8.1
November 28, 2021 — When working with types in any language there is a couple of scenarios that can occur.
First-class callables in PHP 8.1
October 14, 2021 — The newest release of PHP, v8.1, is around the corner and it will introduce a whole lot of new features, from the read only properties to the native enums. It’s pretty exciting!
Initialize objects right into the constructor parameters in PHP 8.1
September 11, 2021 — With the introduction of PHP 8, the language now allows us to declare the class properties right into the constructor parameters. This is called constructor property promotion.
Checking if array keys are out of order using array_is_list() in PHP 8.1
July 8, 2021 — Working with arrays, there might come a time when you want to check if the array in question is a list or not. So, how does an array qualifies as a “list”?
Readonly properties are coming in PHP 8.1
July 7, 2021 — PHP, as a language, is ever-changing and ever-evolving. It’s not a language it was 10 years ago. This is all because the PHP’s core team which has been constantly improving minor things that might not look significant at first glance but when fixed/implemented, can dramatically improve the overall developer experience.
Fibers or Coroutines for asynchronous programming in PHP 8.1
March 9, 2021 — There has been a scarcity of discussion in PHP land when it comes to asynchronous PHP. Maybe, PHP developers don’t seem to be interested in the very idea of it.
Native enumerations (enums) are coming in PHP 8.1
February 7, 2021 — Enums or enumerations or enumerator types are those little data structures that can be used to define a set of named values. More like constants. For instance, a contract status which can be “permanent”, “temp”, or “apprentice”. Or a order status that can be “ordered”, “dispatched”, “shipped” etc.
Array unpacking with string keys coming in PHP 8.1
January 28, 2021 — The spread operator in PHP is getting more awesome in PHP 8.1! So, to give you a primer, with the release of PHP 7.4, it got possible to merge multiple arrays by unpacking arrays into another array using the spread operator.
Short functions could be coming in PHP 8.1
September 28, 2020 — PHP 8 is around the corner and it is coming packed with a lot of new features. But there’s something exciting cooking in PHP 8.1 already.