Skip to content

Instantly share code, notes, and snippets.

@ldommer
Last active June 29, 2025 12:42
Show Gist options
  • Select an option

  • Save ldommer/a4a603008c92b7d0cffe19c1e1972c1c to your computer and use it in GitHub Desktop.

Select an option

Save ldommer/a4a603008c92b7d0cffe19c1e1972c1c to your computer and use it in GitHub Desktop.
Important PHP language features by version since PHP 5.6.
php 5.6:
- constant expressions
- variadic functions
- rest operator (functions declarations / parameters)
- spread operator (function calls / arguments)
- exponentiation shorthand operator
- function and constant use declarations
- default utf-8 character encoding
- hash_equals function
- session_abort and sesseion_reset functions
php 7.0:
- scalar type declarations (property type since 7.4, type hint, return type)
- return type declaration
- null coalescing operator
- spaceship operator
- anonymous classes
- unicode codepoint escape syntax
- grouped imports / use declarations
- throwable interface
- random_bytes and random_int function
php 7.1:
- nullable type declaration (property type since 7.4, type hint, return type)
- void type declaration (return type)
- symmetric array destructuring
- class constant visibility
- iterable type declaration (property type since 7.4, type hint, return type)
- multi catch exception handling
- key declaration for list functions and array destructuring
- negative string offsets
- is_iterable function
php 7.2:
- object type declaration (property type since 7.4, type hint, return type)
- abstract method overriding
- password hashing with argon2
- parameter type widening
php 7.3:
- more flexible heredoc and nowdoc syntax
- trailing commas in function calls (argument lists)
- array_key_first, array_key_last and is_countable functions
php 7.4:
- typed class properties
- arrow functions
- null coalescing assignment operator
- spread operator inside arrays
- opcache preloading
- mb_str_split function
php 8.0:
- named arguments
- attributes
- constructor property promotion
- union type declaration (property type, type hint, return type)
- match expression
- null safe operator
- weak maps
- static type declaration (return type)
- object class operator
- stringable interface
- abstract private methods in traits
- throw as expression
- trailing commas in function declarations (parameter lists)
- mixed type declaration (property type, type hint, return type)
- opcache jit compilation
php 8.1:
- enums
- fibers
- callables as first class objects
- intersection type declaration (property type, type hint, return type)
- never type declaration (return type)
- new in initializers
- readonly properties
- final class constants
- array_is_list function
php 8.2:
- enum properties in constant expressions
- null, false and true type declarations (property type, type hint, return type)
- constants in traits
- readonly classes
php 8.3:
- typed class constants
- final trait methods
- fetch class constants dynamically
- json_validate function
- mb_str_pad function
- str_increment and str_decrement functions
php 8.4:
- property hooks
- asymmetric property visibility
- lazy objects
- new invocation without parentheses
- html5 dom / document parser
- bcmath number class
- bcceil, bcdivmod, bcfloor and bcround functions
- mb_trim, mb_ltrim, mb_rtrim, mb_ucfirst and mb_lcfirst functions
- array_find, array_find_key, array_any and array_all functions
- no implicit nullable types (deprecated)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment