/php-8

Quick pass throw the php 8.0 new features and updates.

Primary LanguagePHP

Php 8.0 release

Quick pass throw the php 8.0 new features and updates.

Documentation release

Php 8.0 improvements/new features

  • Named arguments
  • Attributes
  • Constructor property promotion

Named argument

Details

php run-1.php

Attributes

Details

php run-2.php

Constructor property promotion

Details

php run-3.php

Union types

Details

php run-4.php

Late Static Bindings

static works since 8.0 as self and parent
Details

php run-5.php

Match expression

Details

php run-6.php

Null safe

$country = $session?->user?->getAddress()?->country;
php run-7.php

Comma after the last argument

$user = new User(
    'Name',
    'Last Name',
    50,
);
php run-8.php