Site Tools


php:versions

Table of Contents

PHP Versions

5.4

ref

  • Support for traits has been added.
  • Short array syntax has been added, e.g. $a = [1, 2, 3, 4]; or $a = ['one' ⇒ 1, 'two' ⇒ 2, 'three' ⇒ 3, 'four' ⇒ 4];.
  • Function array dereferencing has been added, e.g. foo()[0].
  • Closures now support $this.
  • Class member access on instantiation has been added, e.g. (new Foo)→bar().
  • Class::{expr}() syntax is now supported.
  • Binary number format has been added, e.g. 0b001001101.
  • Improved parse error messages and improved incompatible arguments warnings.
  • The session extension can now track the upload progress of files.
  • Built-in development web server in CLI mode

5.5

ref

  • Generators added
  • finally keyword added
  • foreach now supports list()
  • empty() supports arbitrary expressions
  • Class name resolution via ::class

5.6

ref

  • Constant expressions
  • Variadic functions via …
  • Argument unpacking via …
  • Exponentiation via **
  • use function and use const

7.0

ref

  • Scalar type declarations
  • Return type declarations
  • Null coalescing operator
  • Spaceship operator
  • Constant arrays using define()
  • Anonymous classes
  • Closure::call()
  • Expectations
  • Group use declarations

7.1

php/versions.txt · Last modified: 2020-04-19 (external edit)