PHP Digest No. 145 (November 26 - December 10, 2018)


    Fresh selection with links to news and materials. In the release: PHP 7.3.0, Symfony 4.2, Composer 1.8.0 and other releases, the end of support for PHP 5.6 and PHP 7.0, the latest offers from PHP Internals, a portion of useful tools, video recordings of reports and much more.
    Enjoy reading!



    Short audio version of the digest in the podcast Five Minute PHP Issue No. 44

    News and Releases


    • PHP 7.3.0 - The long-awaited major PHP release is delivered on schedule. Thanks to all contributors and release managers for the work done! The new version of the interpreter has a number of improvements:
      • Improved Heredoc and Nowdoc RFC syntax
      • Functions json_encode()and json_decode()will throw an exception in case of error and the corresponding RFC flag
      • Ability to use a comma after the last argument of the RFC function
      • Added functions array_key_first()and array_key_last()RFC
      • New function hrtime (), which returns high precision time and does not depend on the system time PR
      • A function has been added is_countable()to check for RFC enumeration
      • Using links in the list()RFC
      • Significant improvement in the garbage collector improves the work with a large number of PR objects
      • The regular expression engine has been updated to PCRE2 RFC
      A complete list of changes in the UPGRADING document .
      I highly recommend looking at the migration guide from PHP 7.2.x to PHP 7.3.x , thanks lex111 for the translation.
    • The world also saw updates to PHP 5.6.39 , PHP 7.0.33 , PHP 7.1.25 and PHP 7.2.13 . And these are the latest releases of branches 5.6 and 7.0 , and PHP 7.1 goes into security support mode . Thus, at present only branches of PHP 7.2 and PHP 7.3 remain relevant.
    • PHP on AWS Lambda - At the AWS re: Invent 2018 conference, among other things, support for custom runtimes for AWS Lambda was announced. PHP out of the box is supported through stackery / php-lambda-layer , but you can also make your own implementation. This means that instead of crutches in the form of launching through Nodejs or Go, now you can write full-fledged lambdas in pure PHP.
    • Composer 1.8.0
    • CakePHP 3.7.0
    • PHPUnit 7.5.0

    PHP internals


    • [RFC] FFI - Foreign Function Interface - The concept from Dmitry Stogov is now designed as a full-fledged offer. The implementation will make it possible to use functions and data structures from C-modules directly. As an example, look at PHP binding for TensorFlow . True, great opportunities also open up wide scope for potential problems and vulnerabilities, therefore, it is proposed by default to allow FFI only in CLI scripts and preloaded files.
    • [RFC] Covariant Returns and Contravariant Parameters - It is proposed to make the types more consistent, in particular, to allow "narrow" the type of the return value in the heirs, and "expand" the type of parameters.
      Hidden text
      interface X {
        function m(Y $z): X;
      }
      interface Y extends X {
        // Тут можно будет сужать тип
        function m(X $z): Y;
      }
      interface Concatable {
          function concat(Iterator $input); 
      }
      class Collection implements Concatable {
          // А тут можно будет расширять тип
          function concat(iterable $input) {/* . . . */}
      }
      


    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 .

    More news and comments on the PHP Digest telegram channel .

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


    Also popular now: