Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PHP7 New Features

PHP7 New Features

Avatar for Ulugbek Miniyarov

Ulugbek Miniyarov

May 03, 2017
Tweet

More Decks by Ulugbek Miniyarov

Other Decks in Technology

Transcript

  1. Migrating from PHP 5.6.x to PHP 7.0.x • Backward incompatible

    changes • New features • Deprecated features in PHP 7.0.x • Changed functions • New functions • New Classes and Interfaces • New Global Constants • Changes in SAPI Modules • Removed Extensions and SAPIs • Other Changes Check out full list at: http://php.net/manual/en/migration70.php
  2. What about PHP6? • Development started in 2005 • Abandoned

    in 2010 • Main cause for discontinuation: Unicode support by default • Other features were introduced in PHP 5.3 RFC about naming PHP7 rather than PHP6: https://wiki.php.net/rfc/php6
  3. PHP7 Error Hierarchy • Throwable ◦ Error ▪ Arithmetic Error

    • DivisionByZeroError ▪ AssertionError ▪ ParseError ▪ TypeError ◦ Exception ▪ RuntimeException ▪ OutOfBoundException
  4. Other BC Breaks • Variable handling • list() handling •

    global only accepts simple variables • … Check out full list of BC Breaks at: http://php.net/manual/en/migration70.incompatible.php
  5. New Feature: Scalar type declarations Scalar types: string, integer, float,

    boolean Note: To force check, enable with declare(strict_types=1)
  6. Other New Features: • Constant arrays using define() • Unicode

    codepoint escape syntax • Closure::call() • Filtered unserialize() • … Check out full list of New Features at: http://php.net/manual/en/migration70.new-features.php
  7. Migrating from PHP 7.0.x to PHP 7.1.x • New features

    • New functions • New global constants • Backward incompatible changes • Deprecated features in PHP 7.1.x • Changed functions • Other changes • Windows Support Check out full list at: http://php.net/manual/en/migration71.php
  8. PHP7.1 Other New Features: • Symmetric array deconstructing • Support

    for keys in list() • Support for negative string offsets • Asynchronous signal handling • … Check out full list for PHP7.1 New Features at: http://php.net/manual/en/migration71.new-features.php
  9. PHP 7 Internals Internal value representation - Part 1: https://nikic.github.io/2015/05/05/Internal-value-representation-in-PHP-7-part-

    1.html Internal value representation - Part 2: https://nikic.github.io/2015/06/19/Internal-value-representation-in-PHP-7-part- 2.html