PHP Digest No. 111 - Latest News, Materials and Tools (June 12 - 25, 2017)



    Fresh selection with links to news and materials. In the release: PHP 7.2.0 Alpha 2, a couple of new RFCs, materials from YiiConf and FWDays, PHP rootkit, and much more.
    Enjoy reading!



    News and Releases



    PHP internals


    • RFC: Retry functionality - It is proposed to extend try-catch-finally with the block and keyword retry. In case of throwing the corresponding exception in the presence of retry, the try block will be repeated:

      try {
          somethingSketchy();
      } retry 3 (RecoverableException $e, $attempt) {
          echo "Failed doing sketchy thing on try #{$attempt}. Retrying...";
          sleep(1);
      } catch (RecoverableException $e) {
          echo $e->getMessage();
      }
      

      try {
          somethingSketchy();
      } catch (RecoverableException $e)
          retry; // Go to top of try block
      }
      

    • RFC: Unary null coalescing operator - It is proposed to implement a unary version of the operator ??added in PHP 7.0:

      if ($_POST["action"]?? === "submit") {
          // Form submission logic
      } else {
          // Form display logic
      }
      

    Instruments



    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 .

    Send link
    Quick search for all digests
    Previous release: PHP Digest No. 110

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

    Is it worth adding retry functionality in PHP?

    • 50.6% Yes 191
    • 31.8% No 120
    • 17.5% Anyway 66

    Also popular now: