php_annotated

.post img.alignico { margin-right: 2px; margin-top: 2px; float: left; }

Greetings everyone,
It’s time for our December edition of PHP Annotated! Read about the latest releases PHP 7.4, Symfony 4.4 and 5.0, Xdebug 2.9, news from PHP Internals, articles on Laravel and Symfony, useful tools, videos, podcasts, and a whole lot more!

⚡️ News & Releases

With the 7.4 release, support for PHP 7.1 is over, and PHP 7.2 will receive one more regular update 7.2.26 on Dec 19. From then there will be only security fixes until Dec 2020. So it's a good time to upgrade: How To Install PHP 7.4 on different platforms.

🐘 PHP Internals

  • [RFC] Weak maps – PHP 7.4 has support for weak refs via the special class WeakReference. But in real-world applications, WeakMap is usually what developers would want to have. It is not possible to implement it with the current WeakReference, so this RFC proposes to add one.

        $map = new WeakMap();
        $obj = new stdClass();
        $map[$obj] = 42;
        var_dump($map);
        // object(WeakMap)#1 (1) {
        //   [0]=>
        //     ["key"] => object(stdClass)#2 (0) {}
        //     ["value"] => int(42)
        //   }
        // }

        // The object is destroyed here, and the key is automatically removed from the weak map.
        unset($obj);
        var_dump($map);
        // object(WeakMap)#1 (0) {
        // }
    

🛠 Tools

  • Infection 0.15.0 – Update for mutation testing tool in PHP. In this release: Codeception support, PHP 7.4, Symfony 4.4 and 5.0, a couple of new mutators.
  • lisachenko/z-engine – An experimental library that allows accessing and modifying the internal structures of PHP itself, such as zend_class_entry, zval, etc., with the help of FFI. This makes it possible to do some incredible manipulations in runtime, for example, add an interface to an existing class, change the type of the object, or overload an operator.
  • krakjoe/ilimit – The extension provides a method to execute a call while imposing limits on the time and memory that the call may consume.
  • Twig 3.0The new version of the template engine has many small improvements, better performance, and cleaner code.
  • fzaninotto/Faker 1.9 – More than a hundred improvements in the tool for generating test data.
  • cekta/di – A decent PSR-11 implementation.
  • clue/phar-composer – Simple PHAR creation for every PHP project managed via Composer. Introductory post.
  • phplrt/phplrt – A tool for creating parsers in PHP by specified grammar. For example, json5 parser.

Symfony

Laravel

video

Astrocasts – Let's start building a Command Bus with Laravel and Tactician 2.x!

Zend/Laminas

  • Laminas transition update – The Apigility project will be renamed to Laminas API Tools (under Laminas\ApiTools namespace), and Expressive will become Mezzio. The official Laminas release is planned for January 2020.

Yii

🌀 Async PHP

video

Creating a RESTful API with ReactPHP: Protected Routes

💡 Misc

🎥 Videos

video

Laravel EU 2019

video

PHP.Barcelona 2019

video

Free course on Blackfire.io from SymfonyCasts

🔈 Podcasts

Give package developers support with symfony/thanks:



Thanks for reading!

If you have any interesting or useful links to share via PHP Annotated, please leave a comment on this post, or tweet me.

Subscribe to PHP Annotated

Your JetBrains PhpStorm Team
The Drive to Develop