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!
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:
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. …
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.
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.
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…
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…
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…
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.
I kept things very…
Symfony Developer @ SensioLabs