PHP Digest 135 (July 9 - 23, 2018)


    In the release: PHP 7.3 alpha 4, ReactPHP 1.0 LTS and other releases, the latest offer "Namespace Visiblity for Class, Interface and Trait" from PHP Internals, recording of reports and webinars, a portion of useful tools, and much more.
    Enjoy reading!



    News and Releases


    • PHP 7.3.0 alpha 4 - The last alpha in the loop. The first beta release is scheduled for August 2. To the list of new features will be added the recently adopted proposal on the introduction of new functions array_key_first()/ array_key_last()for working with arrays:

      $array = ['a' => 1, 'b' => 2, 'c' => 3];
      $firstKey = array_key_first($array); // 'a'
      $lastKey = array_key_last($array); // 'c'

      The voting phase passed the proposal of Deprecations for PHP 7.3 , in which several features were declared obsolete. Also, case-insensitive constants will be declared obsolete in PHP 7.3 .

      As for the proposal on typed properties , it was decided to postpone it until the next version, which is likely to become PHP 8.0.
    • Updates to all current PHP branches with security bug fixes:

      PHP 7.2.8
      PHP 7.1.20
      PHP 7.0.31
      PHP 5.6.37
    • PhpStorm 2018.2 Public Preview - Among the innovations: an updated interface and touch bar support, improved autocompletion for namespaces, structural search and replace, simplified installation of CodeSniffer / MessDetector, and other improvements.
    • Symfoniacs Moscow # August 15 - 2, Moscow, a traditional meeting of PHP / Symfony developers. This time visiting Lamoda.

    Php internals


    • [RFC] Namespace Visiblity for Class, Interface and Trait - It is proposed to introduce access modifiers for classes, interfaces and traits to limit the use of namespace:

      Hidden text
      namespaceExample {
          publicclassA 
          {
             private $property;
          }
          protectedclassB{
             public $property;
          }
          privateclassC{
             protected $property;
          }
      }
      namespaceOtherVendor {
          publicclassFactory
          {
              publicfunctionA()
              {
                  returnnew \Example\A();  // Allowed by public
              }
              publicfunctionB(){
                  returnnew \Example\B();  // Not allowed because // namespace is not shared
              }
              publicfunctionC(){
                  returnnew \Example\C();  // Not allowed because// not from same namespace
              }
          }
      }

    Instruments


    • PHLAK / Twine - Object wrapper for working with strings. Alternative danielstjules / Stringy .
    • atlasphp / Atlas.Orm 3.0 - Interesting ORM.
    • makasim / values - The library is trying to combine the best of the world of objects and arrays. You work with objects as usual, and arrays will be used under the hood.
    • AI-BOLIT - Free anti-virus scanner for PHP sites.
    • spatie / crawler - Powerful Guzzle-based crawler, as well as Chrome and Puppeteer for rendering JavaScript sites.
    • spatie / code-outliner - The package will create a visual representation of your code, in order to understand how it is perceived, abstracting from the content.

    Study materials




    Audio and video




    Entertaining


    • Rialtime Tayphint in PhpStorm - what do you think?
    • Rayne / ecoji-php - Base64 is boring, encode a string into an emoji sequence:

      useRayne\Ecoji\Ecoji;
      $ecoji = new Ecoji;
      $ecoji->encode("Base64 is so 1999, isn\'t there something better?\n");
      


    Thanks for attention!

    If you notice an error or inaccuracy - please inform the PM .
    Write questions and suggestions by mail or twitter .

    Send link
    Search links for all digests
    Previous release: PHP Digest number 134


    Also popular now: