Skip to content

Instantly share code, notes, and snippets.

@romanitalian
Last active August 5, 2018 08:24
Show Gist options
  • Save romanitalian/e65980f57d7db73763ad57bab83e1b39 to your computer and use it in GitHub Desktop.
Save romanitalian/e65980f57d7db73763ad57bab83e1b39 to your computer and use it in GitHub Desktop.
5.3 namespaces, closures
5.4 traits, short array syntax
5.5 finaly, generators
5.6 variadic functions, argument unpacking
7.0 return types, scalar type hints
7.1 const visibility, nullables, multiple exceptions
7.2 object type hint, abstract function override
5.3 - namespaces
- closures
- ?:
- __DIR__
- late static binding
- __callstatic
- goto
- NOWDOC <<<OEF echo $a; // 3 <<<'EOF' echo $a; // $a <<<"EOF" echo $a; // 3
- error_reporting = E_ALL // www/test; error_reporting = 0 // www/production
- user_ini.filename = ".user.ini" - собственный аналог .htaccess
5.4 - traits
- short array syntax
5.5 - finally
- generators
5.6 - variadic functions (function foo(...$args) {}),
- argument unpacking (function foo($a, $b) echo foo($ar))
- constant expressions
- php://input is reusable
- __debugInfo() - custom out in var_dump()
- pgsql async support
- `use function, use const` - in namespaces
- 2**3 = 8 - exponention via **
7.0 - return types
- scalar type hints
- null coalescing operator (??)
- errors to Exceptions
- anonymous classes
- spaceship operator (<=>)
7.1 - const visibility
- nullables
- catch multiple exceptions
- destructurisaction (list -> [$a, $b, $c], named list)
- iterable pseudo type hint
7.2 - object type hint
- abstract function everride
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment