Linux command-line. Bash. GNOME Terminal. screenshot

PHP 8.2's Subtle New Features

By Jim (jimbo2150) • Published

PHP version 8.2 was released on December 8, 2022 and I'm sure you've already heard about the great new features. The Randomizer & random generator engines classes, DNF types; constants within traits; the sensitive parameter trait; static return types for dates; the n regular expression modifier; false, true, and null types; the readonly class modifier, a handful of deprecations, and a small performance bump.

These features are great. They add some new things to play with, fix a few issues, and provide the usual speed boost. What about the more subtle features that aren't reported on. They need some love too.

phpinfo()'s Visual Upgrade

The first thing I will go over is a feature that doesn't appear to be reported on anywhere. Not even in the changelog. Why?

The phpinfo() function got a facelift. It now supports dark mode using the OS and browser's CSS prefers-color-scheme media query. There is also now sticky headers for tables. The headers will stay at the top of the screen while you continue scrolling.

Here is a screen capture of phpinfo():

Some other new features that go unnoticed...

Upgrade Soon!

PHP 8.2 has many features that will make development and testing with PHP easier. It's easy to overlook the more suble and less-reported-on features, but they are often some of the more useful or awaited changes. It's highly reccomended that you upgrade to version 8.2 soon and always keep your software versions up-to-date to get the latest features and security fixes.

Categories: