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

biometrics

Well-Known Member
Joined
Oct 17, 2019
Messages
20,267
PHP 8.0 introduces major changes to the language, including an improved type system, a new JIT compiler, union types and other enhancements.

 

Johnatan56

Well-Known Member
Joined
Jun 22, 2020
Messages
1,530
Location
Vienna

Was a better link.

Summary capping most of it in case you haven't checked since November, generally would consider upgrading projects just based on nullsafe, str_contains, union types, and stable sorting functions:

Union types: function parameters and return can have return types.
JIT (Just in time) compiler : don't think this will be noticeable for most.
Nullsafe operator.
Named arguments (so method call can do foo (a: 1, b: 2))
Attributes
Match (basically a switch that can return stuff)
Constructor property promotion (which is a bad idea imho)
Added static return type
Mixed return type
Can now throw errors as an expression
Removed inheritance check on private methods
WeakMap (will probably have a large impact/use in caches)
Non capture exceptions
Trailing comma in a list is allowed
DateTime from interface
Stringable interface (sugar for saying toString() exists)
Str_contains exists
Str_starts_with and str_ends_with
Stable sorting functions
 
Top