Let’s dive into these “minor” still important improvements coming to the language in November this year

Photo by Wesson Wang on Unsplash

Alright, so my last article about PHP 8.1 coming features was pretty well received, and I thought it was worth to go for a second round to talk about all these interesting changes, improvements and features coming to us. Let’s dive into it!

Pure intersection types has been accepted and is being implemented

While writing my first article about PHP 8.1 coming features, pure intersection type was in voting phase. It has been accepted and is now pending for implementation. We have great chances to see this coming to the next minor version of PHP, in November. Just to quickly remind, pure intersection typing allows you to write such code:

Learn how works Symfony’s vault for your production sensitive information while your coffee is cooling down

Photo by Brock Wegner on Unsplash

A bit of context

Keeping sensitive information in secured places has always been a bit tricky. Where do you store your production database password? Where do you store all the required credentials for your application to work? During my everyday job, I often have to set-up CIs (continuous integrations) and CDs (continuous delivery) with a multitude of tools. These can be Gitlab CI, Bitbucket CI or Github Actions for example. And dealing with sensitive information is always a challenge.

Indeed, you won’t store sensitive production information directly in your source code. …

The coming version of PHP, scheduled for November 2021, is already packed with a lot of super exciting features.

Photo by Tianyi Ma on Unsplash

String-keyed array unpack

A simple operation, which wasn’t allowed until PHP 8.1. A code snippet worth a thousand words, here is what you’ll be able to do now:

This seems super simple, but you were only allowed to this with arrays with integer keys. As soon as you tried it with string-keyed arrays, you would get a fatal error.

Note that this new feature produce the exact same result as array_merge, which you can use with string-keyed array on any PHP version where it is available.

RFC: https://wiki.php.net/rfc/array_unpacking_string_keys


Internationalization of dates and format localization has always been a bit of a pain…

Recent evolution of PHP is making it more demanding, for the best of everybody.

Photo by Ben on Unsplash

Strict typing

Maybe one of the most important thing you should be using on newest versions of PHP.

There was a time you were allowed to pass any data to any variable, cast variables as much as you wish, without any way to prevent this. Converting an array variable to a string, a string to an integer, etc. That can be pretty confusing, and potentially a bug nest. What will happen if you multiply a string by an integer for example? Well, the result is totally unexpected. This…

Take control over shared resources across PHP processes with this simple, yet powerful tool

Asynchronous tasks in PHP

You certainly know it and I don’t teach you anything by telling you this: pure multithreading and parallelism do not exist with PHP. Although some solutions like Tornado from the French company M6W eb try to compensate for this lack, it is not a native solution as we could find it with some languages more or less low level, such as C, C++, Java or C#.

So there you have it, obviously we don’t have a way to do real parallelism, but we can get close. That’s what I’m referring to when I talk about asynchronous tasks.

You will surely…

A necessary activity to keep you up to date, yet far from obvious when you’ve never done it

Photo by Alex Kulikov on Unsplash

Technology intelligence is an activity that seems to be rather neglected by IT workers when I look around. Technology intelligence basically consists of reading tech articles to stay up-to-date about latest technologies, what’s happening in the IT world right now, etc. Many recruiters may ask you during job interviews how you do your technology intelligence. I have noticed that around me, few people actually do this activity on a daily basis, or even regularly.

One of the main reasons is simply that if you have never done it, it can be complicated to keep up with the latest developments and…

A bit of context

For so long I’ve been struggling to read var_dump output when I’m not using Xdebug or Symfony’s VarDumper. Not using those two tools can be for any reason.

Surprisingly, I couldn’t find any tool to beautify these outputs online, as it is done with tools like JSON formatter, to only cite one. That’s why this idea came to me: create my very own var_dump formatter. This way, every PHP developer will be able to format its var_dump output without installing anything.

This tool didn’t exist yet, and the opportunity was too cool not to take it.

Which tools I used

I kept things very…

Alexandre Daubois

Symfony Developer @ SensioLabs

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store