PHP Digest No. 158 (June 3-17, 2019)

    Fresh selection with links to news and materials. In the release: PHP 7.4.0 alpha 1, DevConfX, accepted and new RFCs from PHP Internals, a portion of useful tools, and much more.

    Enjoy reading!

    News and Releases

    PHP internals

    • [RFC] Allow throwing exceptions from __toString () - Offer accepted unanimously.
    • [RFC] Numeric Literal Separator - The proposal crossed the threshold for voting, and so in PHP 7.4 it will be possible to use the underscore as a separator in numbers:

      $i = 197_823_459; // 197823459
    • [RFC] Nullsafe Calls - An old proposal is being discussed again at Internals. It considers the possibility of adding a new operator ?->that would allow making safe chains of method calls, in case the return value can be null:


      There is a similar offer in ECMAScript , but in Hack this feature is already implemented .
    • [RFC] Alternative “use” syntax for Closures - The author of the proposal considers the use syntax in closures not very convenient and suggests transferring it to the function body:

      Hidden text
      // Так сейчас
      $closure = function (
          ArgumentType $argument1,
          ArgumentType $argument2,
          ArgumentType $argument3,
          ArgumentType $argument4
      ) use ($importVariable1, &$importVariable2, $importVariable3, &$importVariable4): ReturnType {
          // ...
      // Предлагается вот так
      $closure = function (
          ArgumentType $argument1,
          ArgumentType $argument2,
          ArgumentType $argument3,
          ArgumentType $argument4
      ): ReturnType {
          use $importVariable1, &$importVariable2;
          use $importVariable3, &$importVariable4;
          // ...
    • audioPHP Internals News # 13 - Sara Goleman (release manager PHP 7.2) and Derick Rethans (PHP 7.4) talk about release management.
    • audioPHP Internals News # 14 - With Nikita Popov on exceptions in __toString ().






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

    Also popular now: