PHP Digest No. 84 - interesting news, materials and tools (April 10 - 24, 2016)



    We bring to your attention the next selection with links to news and materials.

    Enjoy reading!


    News and Releases


    • High-performance PHP - PHP-PM - Two years ago, the author of the post published a note on launching a Symfony application using ReactPHP. Then it allowed to get a tenfold increase in productivity. In a post, the author conducts a retrospective and review of the current status of the project. For example, now using php-pm you can also run applications on Laravel, Zend, Drupal.
    • WordPress 4.5 “Coleman” - The released version contains a number of subtle improvements, but among the changes planned for 4.6, you can notice the proposal for the implementation of PSR-4 autoloader.
    • league / oauth2-server 5.0 - Fresh update of OAuth 2.0 server implementation in PHP. Under the hood, support for PSR-7, JWT, and many improvements. Post in support.
    • nikic / PHP-Parser 2.1.0


    Php


    • RFC: Attributes - It is proposed to implement the mechanism of native annotations in PHP. The syntax is borrowed from Hack . Attributes are not executed, but stored in the abstract PHP syntax tree and can then be used in PHP extensions, preprocessors, and directly in scripts.
      <<...>>
      <<...>>
      function foo() {}
      

    • RFC: Anonymous Class Lexical Scope - The author suggests solving the problem of passing dependencies to an anonymous class. For this, it is proposed to use useboth in closures:
      $foo = 5;
      $foo = new Bar() use($foo) {
          public $foo;
      };
      

    • RFC: Union Types - Starting with PHP 5.1, you can explicitly specify the type of parameters to pass, and with PHP 7.0 you can also specify the type of return values. It is proposed to make it possible to specify multiple types:
      function (Array | Traversable $in) {
          foreach ($in as $value) {
              echo $value, PHP_EOL;
          }
      }
      

    • RFC: Nullable Types - It is also proposed to make it possible to indicate a type, which may be empty null:
      function foo_nullable(?Bar $bar) {}
      foo_nullable(new Bar); // valid
      foo_nullable(null);    // valid
      foo_nullable();        // invalid
      

    • RFC: Generic Types and Functions - The proposal to implement generics (templates) in PHP has generated a wave of discussions.
      What do you think, how justified is this possibility in PHP? Leave your vote in the survey at the end of the post and share your opinion in the comments.


    Instruments




    Learning Materials




    Audio and video




    Entertaining




    Thanks for attention!

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

    Send links to interesting articles or useful tools that were not in the PHP Digests , and your name will be next to the link in the release.

    Quick Search All Digests
    Previous Issue: PHP Digest No. 83

    Only registered users can participate in the survey. Please come in.

    Generics (templates) in PHP?

    • 51.3% for 176
    • 17.2% vs 59
    • 31.4% Not defined 108

    Also popular now: