PHP Digest No. 81 - interesting news, materials and tools (March 1 - 13, 2016)



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

    Enjoy reading!


    News and Releases




    Php


    • RFC: Null Coalesce Equal Operator - It is proposed to implement a combined operator ??=in addition to the usual ??one added in PHP 7.
      // Следующие две строки эквивалентны
      $this->request->data['comments']['user_id'] = $this->request->data['comments']['user_id'] ?? 'value'; 
      $this->request->data['comments']['user_id'] ??= 'value';

    • RFC: Short ternary Equal Operator - It is also proposed to implement a combined ternary operator:
      $x = $x ?: $y; 
      $x ?:= $y;

    • RFC: “var” Deprecation - It is suggested that the keyword be deprecated var. Interestingly, this keyword was already deprecated in versions 5.0.0 - 5.1.2, and at the moment it is only a synonym public.
    • RFC: Catching Multiple Exception Types - The opportunity to catch several types of exceptions in one catch block is proposed for consideration:
      try {   
          // Some code...
      } catch (ExceptionType1 | ExceptionType2 $e) {
         // Code to handle the exception
      } catch (\Exception $e) {
         // ...
      }

    • RFC: Traits with interfaces - It is proposed to make it possible to use interfaces in traits:
      interface I {
          function foo();
      }
      trait T implements I {
          function foo() {
          }
      }


    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.

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


    Also popular now: