Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 5.14 KB

supported-php-features.md

File metadata and controls

13 lines (10 loc) · 5.14 KB

Supported PHP features

All packages in this monorepo require PHP 8.1 for development, but contain only PHP code that can be transpiled to PHP 7.2 for production.

The list of supported PHP features is the following:

PHP Version Features
7.2 Everything
7.3 Reference assignments in list()/array destructuring => [&$a, [$b, &$c]] = $d
Except inside foreach (#4376)

Flexible Heredoc and Nowdoc syntax

Trailing commans in functions calls

set(raw)cookie accepts $option argument

Functions:Exceptions:
7.4 Typed properties

Arrow functions

Null coalescing assignment operator => ??=

Unpacking inside arrays => $nums = [3, 4]; $merged = [1, 2, ...$nums, 5];

Numeric literal separator => 1_000_000

strip_tags() with array of tag names => strip_tags($str, ['a', 'p'])

covariant return types and contravariant param types

Functions:
8.0 Union types

mixed pseudo type

static return type

::class magic constant on objects

match expressions

catch exceptions only by type

Null-safe operator

Class constructor property promotion

Trailing commas in parameter lists and closure use lists

Interfaces:
  • Stringable
Classes:
  • ValueError
  • UnhandledMatchError
Constants:
  • FILTER_VALIDATE_BOOL
Functions:
8.1 Readonly properties

First-class Callable Syntax

New in initializers

Pure Intersection Types

Never return type

Final class constants

Array unpacking support for string-keyed arrays

Functions: