Back to Home

PHP Digest No. 152 (March 11 - 25, 2019)

digest · php digest · PHP · Symfony · Laravel · Yii · PHP 8 · PHP 7.4 · PHP Russia · JIT · WordPress

PHP Digest No. 152 (March 11 - 25, 2019)


    Fresh selection with links to news and materials. In the release: fresh RFC offers and other news from PHP Internals, a portion of useful tools, and many other materials and news!

    Enjoy reading!


    News and Releases


    • PHP Russia 2019 - Moscow, May 17 - The acceptance of applications for reports is coming to an end and there are already several confirmed speakers! First of all, these are the top contributors of the PHP core Nikita Popov and Dmitry Stogov, also the author of spiral / roadrunner Anton Titov, the author of the PHP-ML library for machine learning on PHP Arkadiusz Kondas and others .
    • PHP fwdays'19 - Kiev, June 1 - An interesting program is also planned at a conference in Kiev and the creator of Symfony Fabien Potencier has already been announced.
      For readers of the PHP Digest, a 15% discount on the promotional code: PHP-digest-fwdays.
    • Enrico Zimuel joins the Elastic team - After 11 years at Zend, Enrico moves to Elastic, where he will be responsible for the PHP libraries for Elasticsearch. Sent @dmitrybalabka . The fate of other members of the Zend team, who announced their departure from Rogue Wave in October, is also interesting .

    PHP internals


    • [RFC] New custom object serialization mechanism - Proposal accepted. PHP 7.4 implements a new mechanism for serializing objects and adds two magic methods:
      Hidden text
      // Returns array containing all the necessary state of the object.
      public function __serialize(): array;
      // Restores the object state from the given data array.
      public function __unserialize(array $data): void;
      
    • [RFC] JIT - JIT for PHP implements support for Windows and ZTS. The latter means that it can be used in multi-threaded applications. According to the proposal, a vote has already started, judging by the course of which it will probably be adopted for PHP 8.0, but the idea of ​​including it in PHP 7.4 will not get enough support.
      The topic also has a post with Redis-server benchmarks in PHP clue / php-redis-server , where the author gained ~ 4-23% on the version with JIT.
    • [RFC] Arrow Functions 2.0 - The third attempt to implement short lambdas in PHP. This time the syntax is suggested
      $y = 1;
      $fn1 = fn($x) => $x + $y;
      

      At the same time, variables from an external scope are automatically bound by value and no need to use ().
      Internals also discusses alternative syntax options:
      ($x) ==> $x + $y;
      

      \($x) => $x + $y;
      
    • [RFC] Generator comprehensions - The concept is framed in a complete proposal for the implementation of list inclusion (list comprehension). Compared to the concept, as in short lambdas, there is no need to use use():
      Hidden text
      $y = 3;
      $gen = [for $list as $x if $x % 2 yield $x * $y];
      
    • [RFC] Deprecate curly braces array access - Currently, both square and curly braces can be used to access elements of arrays and strings. And although they are equivalent, curly braces still do not work, for example, to add an element to an array “$arr{} = 1;” or declare an array “$a={1,2};” . It is suggested that the curly brackets be fixed in this context and that only square brackets be left. Do you use curly braces?
    • videoPHP Internals News Episode 2 Podcast: PHP Compiler and FFI - Anthony Ferrara visiting Derick Rethans.
    • PHP 7.4 release managers announced - They are Peter Kokot and Derick Rethans .

    Instruments



    Symfony



    Laravel



    Yii



    Security



    Async php



    CMS



    Learning Materials




    Entertaining


    • ircmaxell / php-compiler - The long-abandoned PHP compiler idea from Anthony Ferrara was reincarnated thanks to FFI in PHP 7.4. Theoretically, the compiler is able to generate native machine code and produce a binary executable without a PHP virtual machine. In practice, this is only a concept that supports nothing at all, but the idea is interesting.

    Thanks for attention!

    If you notice a mistake or inaccuracy - please inform me in PM .
    Questions and suggestions write to mail or twitter .

    More news and comments on the PHP Digest Telegram Channel .

    Send link
    Search links for all digests
    Previous release: PHP Digest No. 151

    Read Next