PHP Digest number 148 (January 14 - 28, 2019)

    Fresh selection with links to news and materials. In the release: the PEAR repository is hacked, about the future of Xdebug, the PHP Russia 2019 conference, the latest releases, RFC offers from PHP Internals, a portion of useful tools, and much more.

    Enjoy reading!

    News and Releases

    • The PEAR repository has been hacked - has gone offline and is not working yet. It is known that a malicious code was embedded in the file pear.phar. You are at risk if you manually downloaded this file after 12/20/2018. To check you need to download the "clean" file from GitHub and compare the checksums. For automation there is a script . If you used an OS with PHP preinstalled or installed using the package manager, then it is extremely unlikely that you ever used go pear.phar. While the site is down, there are workarounds for installing PEAR packages and building PHP from source .
    • The Future of Xdebug - Author Xdebug Derick Rethans talked about technical debt and expansion issues. He leaves MongoDB , where he has been working for the last 7 years. In the near future, I intend to engage in refactoring and finalizing Xdebug, as well as looking for ways of financing. You can support Derik on his Patreon .
    • Who pays PHP development? - At the end of the post it is said that the organization together with some key members of the PHP team are planning to solve the problem of financing and supporting PHP, and will soon announce it.
    • Perforce Swallows Rogue Wave Software
    • PhpStorm 2019.1 EAP - The PhpStorm early access program was launched , thanks to which you can be the first to experience new IDE features for free. New features include: debugging Twig templates, the ability to sort imports (use expressions), phpcbf support for fixing style bugs, and many other improvements.
    • ruOnliner PHP Meetup # 3 - Minsk, February 9.
    • ruPHP Russia 2019 - a specialized PHP conference will be held in Moscow on May 17!
      How the idea appeared and about the team can be read in the post of Alexander Makarov . In full swing accepted applications for reports. The official @PHPRussiaConfChannel channel and the @PHPRussiaConfTalks chat with discussions are also available in Telegram .

    Php internals

    • [RFC] Null Coalescing Assignment Operator - The proposal was accepted more than two years ago. And here implementation of the combined operator with check on null is ??=finally finished and completed. Despite the seeming simplicity of the task, the implementation was very nontrivial .
      Total: $a ??= $bequivalent $a ?? ($a = $b). In the case of a $a[foo()] ??= bar()function foo()will be called exactly once, and bar()will be called if $a[foo()]equal null(or not set).
      In the topic of a good post about other short operators in PHP .
    • [RFC] New custom object serialization mechanism - Fresh RFC from Nikita Popov. It is proposed to introduce a new mechanism for serializing objects by adding a couple of magic methods:

      // Returns array containing all the necessary state of the object.publicfunction__serialize(): array;
      // Restores the object state from the given data array.publicfunction__unserialize(array $data): void;

      This change is intended to fix interface problems Serialiazable. Unfortunately, it is impossible to fix the interface itself, but if the proposal is adopted, there will be a working alternative.
    • [RFC] Code free constructor - It is proposed to add an automatic constructor whose task is to initialize properties:
      Hidden text
          public $vendor;
          public $cc;
          public $whells = 2;
          publicfunction__construct($vendor, $cc){
              $this->vendor = $vendor;
              $this->cc     = $cc;
          //other methods
          publicfunction__construct($cc, $whells){
              parent::__construct("Custom", $cc);
           // $this->cc = $cc;  this statement will be added within proposed realisation$this->whells = $whells;

      для кода выше предлагается следующий альтернативный синтаксис:
      classMotorCycle($vendor, $cc){
          public $whells = 2;
          //other methods
      classMyCustomMotorCycle($cc, $whells) extendsMotorCycle("Custom", $cc){ };




    Async php


    Study materials


    • Code Galaxies - A fun 3D visualization of the relationships between Composer packages.

    Thanks for attention!

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

    More news and comments on the PHP Digest Telegram channel .

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

    Also popular now: