$30 off During Our Annual Pro Sale. View Details »

PHP7 @ PHP Day Spain 2015

PHP7 @ PHP Day Spain 2015

Presentation of the new PHP version along with bits of history and benchmarks of our Ulabox app at the PHP Day Spain 2015

Albert Casademont

January 31, 2015
Tweet

More Decks by Albert Casademont

Other Decks in Technology

Transcript

  1. View Slide

  2. View Slide

  3. That's Me!
    Albert Casademont
    ulabox.com
    @acasademont
    (no Linkedin available, sorry!)

    View Slide

  4. View Slide

  5. View Slide

  6. View Slide

  7. HipHop Virtual Machine
    HipHop for PHP

    View Slide

  8. View Slide

  9. PHP6
    PHPNG

    View Slide

  10. ¡PHP7!

    View Slide

  11. but first...

    View Slide

  12. Get PHP 5.6
    PLEASE

    View Slide

  13. variadics

    View Slide

  14. View Slide

  15. splat operator

    View Slide

  16. View Slide

  17. ** operator

    View Slide

  18. View Slide

  19. + nice speed bump

    View Slide

  20. PHP7
    a.k.a.
    PHPNG

    View Slide

  21. Internals
    heavily modified data structs
    (current extensions won't work)
    call frame optimization
    new memory manager
    we finally have an AST!
    no JIT (yet)

    View Slide

  22. Internals
    Immutable arrays
    PCRE with JIT
    new JSON parser
    ...and more to come
    (watch Dmitry Stogof's talk on PHP7 internals for more!)

    View Slide

  23. Removed features
    mysql extension :'(
    ereg extension
    ASP style tags
    ...and many more

    View Slide

  24. View Slide

  25. null coalesce
    https://wiki.php.net/rfc/isset_ternary

    View Slide

  26. View Slide

  27. uniform variable
    https://wiki.php.net/rfc/uniform_variable_syntax

    View Slide

  28. View Slide

  29. ¡¡¡return types!!!
    https://wiki.php.net/rfc/return_types

    View Slide

  30. View Slide

  31. View Slide

  32. View Slide

  33. ¿named parameters?
    https://wiki.php.net/rfc/named_params

    View Slide

  34. View Slide

  35. ¿nullable types?
    https://wiki.php.net/rfc/nullable_types

    View Slide

  36. View Slide

  37. ¿scalar type hinting?
    https://wiki.php.net/rfc/scalar_type_hints

    View Slide

  38. View Slide

  39. View Slide

  40. Test environment
    VM Debian 7 1GB RAM, 1 core, SSD
    ulabox.com symfony 2 index / product page
    PHP 5.5 / 5.6 / 7.0
    opcache.validate_timestamps = 0
    opcache.enable_file_override = 1
    HHVM 3.5
    Hhvm.server_stat_cache = 1
    No extensions! (APCu)
    Nginx, Redis, Solr, MySQL

    View Slide

  41. PHP 5.5 PHP 5.6 XXX XXX
    0
    20
    40
    60
    80
    100
    120
    140
    160
    180
    200
    102 101
    61 64
    133
    130
    79
    83
    190 190
    112
    32
    Index
    Product
    Bench.php
    msec

    View Slide

  42. and the
    Oscar goes
    to...

    View Slide

  43. PHP 5.5 PHP 5.6 PHP 7.0 HHVM 3.5
    0
    20
    40
    60
    80
    100
    120
    140
    160
    180
    200
    102 101
    61 64
    133
    130
    79
    83
    190 190
    112
    32
    Index
    Product
    Bench.php
    msec

    View Slide

  44. Resources
    https://wiki.php.net/phpng
    https://wiki.php.net/rfc
    http://news.php.net/php.internals
    https://joind.in/talk/view/12068
    https://atlas.hashicorp.com/rasmu
    s/boxes/php7dev
    https://github.com/php/php-src

    View Slide

  45. gràcies ;)

    View Slide