PHP Digest No. 159 (June 17 - July 1, 2019)


    Fresh selection with links to news and materials. In the release: PHP 7.4.0 alpha 2, BeerPHP, a review of the latest RFCs from PHP Internals, including Strict operators directive, a portion of useful tools, videos and much more.

    Enjoy reading!



    News and Releases



    PHP internals


    • [RFC] Normalize arrays' "auto-increment" value on copy on write - It is proposed to reset the value of “auto-increment” when copying an array, as if when copying a new empty array would be filled one by one from the old one.
      Hidden text
      $array = [0, 1, 2, 3];
      unset($array[3], $array[2]);
      $arrayCopy = $array;
      $arrayCopy[] = 2;
      // Если предложение будет принято, то следующее выражение будет истинно.
      // А на данный момент массивы не эквивалентны.
      assert($arrayCopy === [0, 1, 2]);
      
    • [RFC] Strict operators directive - PHP performs implicit type conversion for most operators. And since the conversion rules are quite complex, often this can lead to unpredictable results. In this RFC, it is proposed to introduce a new directive strict_operatorsthat will limit type conversions and allow throwing errors TypeErrorfor incompatible operands. The document is very detailed and describes many examples, I recommend that you look through the whole. The directive also changes the behavior of the construct switch.
    • [RFC] Deprecations for PHP 7.4 - Another bundle of functionality is proposed to be deprecated in 7.4 and then removed in 8.0. From the interesting:
        • Now implode()arguments can be passed in any order - it is proposed to leave only the canonical implode(string $glue, array $pieces);
        • Instead, floatyou can use the type real- the latter will be removed.
    • [The RFC] of str the Add the begin and end functions The - It is proposed to add a function str_begins(), str_ibegins(), str_ends(), str_iends(), mb_str_begins(), mb_str_ibegins(), mb_str_ends(), and mb_str_iends().
    • For the php-src repository, they added a pipeline to Azure DevOps .
    • audioPHP Internals News # 15 - About improvements base_convert()with Scott Dutton .
    • audioPHP Internals News # 16 - With Joe Watkins on [RFC] Unbundle ext / recode .

    Instruments



    Symfony



    Laravel



    Yii


    • cebe / yii2-app-api - Yii2 application template for quickly creating APIs based on OpenAPI specs.

    Async php



    Learning Materials



    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. 158


    Also popular now: