Programming languages: PHP 8.0 brings big updates. Here's what's new

PHP 8.0 introduces major changes to the language, including an improved type system, a new JIT compiler, union types and other enhancements.

3 years ago   •   2 min read

By Maxwell Graham

PHP version 8.0 has arrived, bringing with it a major update to the 25-year-old programming language.

PHP 8.0 introduces a number of new features to the language, most notably union types, a Just In Time (JIT) complier, nullsafe operator, attributes and 'named arguments.'

The JIT compiler is designed to bring performance improvements to web applications by turning code into instructions for the CPU at runtime. Meanwhile, union types is a feature that allows data of more than one type to be held by a variable.

Named arguments allow developers to assign values to a function by specifying the value name, allowing optional parameters to be ignored.

Alongside these, version 8.0 of PHP brings optimizations and enhancements to the language's type system, syntax, error handling and consistency.

PHP was created by Danish-Canadian programmer Rasmus Lerdorf in 1994, with Lerdorf releasing the language's source code to the public one year later. By 1998, PHP was reportedly being use by around 1% of all web domains.

JavaScript in progress
Photo by Clément H / Unsplash

It is a backend programming language, meaning it's primarily used to handle interconnections between servers and data handling, as opposed to GUI or frontend interfaces.

While PHP is still widely used for building web applications, in recent years more modern programming languages have overtaken it in terms of its adoption by developers.PHP programmer and stitcher.io developer, Brent Roose, said in a blog post in January that the language had acquired "a reputation of messy codebases, inexperienced developers, insecure code, and [an] inconsistent core library" over the years, though added that it still offered "a great choice for web development if used wisely and correctly".

Stefan Priebsch, co-founder and principal consultant at the PHP Consulting Company, advised that migration to PHP 8 "requires more preparation" than the upgrade from PHP 5.x to PHP 7, due to legacy issues that had been removed from the language.

Speaking to German publication, Heise, Preibsch said: "I advise you to prepare your existing applications step by step for use with PHP 8 before planning the actual migration. On the other hand, if you develop a new application, there is nothing to be said against using PHP 8 right from the start and benefiting from the new language features."

Spread the word

Keep reading