
PHP Digest No. 159 (June 17 - July 1, 2019)

Fresh selection with links to news and materials. In the release: PHP 7.4.0 alpha 2, BeerPHP, a review of the latest RFCs from PHP Internals, including Strict operators directive, a portion of useful tools, videos and much more.
Enjoy reading!
News and Releases
- PHP 7.4.0 alpha 2 - Second planned alpha release with bug fixes . A complete list of new features and changes is available in the UPGRADING document . Another alpha is expected and then feature-freeze on July 22nd.
Reviews: New in PHP 7.4 , What's New in PHP 7.4 (Features, Deprecations, Speed) . - BeerPHP Moscow # 4, July 4, 2019 - The fifth anniversary meeting of the PHP community in Moscow for informal communication. By the way, in order to organize BeerPHP in your city, you can create an issue in the beerphp / meta repository . The movement is very popular and goes well in the JS-world . Give BeerPHP to every city!
- PHP Meetup in Moscow (SkyEng office), August 22, 2019
PHP internals
- [RFC] Normalize arrays' "auto-increment" value on copy on write - It is proposed to reset the value of “auto-increment” when copying an array, as if when copying a new empty array would be filled one by one from the old one.Hidden text
$array = [0, 1, 2, 3]; unset($array[3], $array[2]); $arrayCopy = $array; $arrayCopy[] = 2; // Если предложение будет принято, то следующее выражение будет истинно. // А на данный момент массивы не эквивалентны. assert($arrayCopy === [0, 1, 2]);
- [RFC] Strict operators directive - PHP performs implicit type conversion for most operators. And since the conversion rules are quite complex, often this can lead to unpredictable results. In this RFC, it is proposed to introduce a new directive
strict_operators
that will limit type conversions and allow throwing errorsTypeError
for incompatible operands. The document is very detailed and describes many examples, I recommend that you look through the whole.The directive also changes the behavior of the construct
switch
. - [RFC] Deprecations for PHP 7.4 - Another bundle of functionality is proposed to be deprecated in 7.4 and then removed in 8.0. From the interesting:
• Nowimplode()
arguments can be passed in any order - it is proposed to leave only the canonicalimplode(string $glue, array $pieces)
;
• Instead,float
you can use the typereal
- the latter will be removed. - [The RFC] of str the Add the begin and end functions The - It is proposed to add a function
str_begins()
,str_ibegins()
,str_ends()
,str_iends()
,mb_str_begins()
,mb_str_ibegins()
,mb_str_ends()
, andmb_str_iends()
. - For the php-src repository, they added a pipeline to Azure DevOps .
PHP Internals News # 15 - About improvements
base_convert()
with Scott Dutton .PHP Internals News # 16 - With Joe Watkins on [RFC] Unbundle ext / recode .
Instruments
- cycle / orm - Powerful ORM for long-lived applications and more. Detailed documentation is prepared with an example of a dynamic definition of a circuit and links.
- SerafimArts / pipe - A wrapper for recording operations in the form of a chain of calls (pipe operator). Sent Ostap34JS .
- postaddictme / instagram-php-scraper - The library mimics the behavior of Instagram clients to receive data without using the official API. There is also a mgp25 / Instagram-API library .
- helhum / dotenv-connector - A handy plugin for Composer that reads variables from .env and makes them available throughout the application.
- patrickschur / language-detection - On a given line determines with what probability it is written in a particular language.
- thephpleague / commonmark - Markdown parser. Release Overview 1.0.0 .
Symfony
- New member to the Symfony Core team: Yonel Ceruto
- PHP 7.4 Preload in Symfony - Nikolas Grekas prepared a PR in Symfony with a preload implementation, which was added in PHP 7.4. Performance tests have not yet been conducted. sent dmitrybalabka
- Twig enhancements: whitespace control , simple macros , added Filter, Map and Reduce .
- Effective fixture testing in Symfony 4
Work with JSON RPC in Symfony 4
Laravel
- mpociot / laravel-test-factory-helper - Generates test factories based on existing models.
- laravel-preload / preload.php - PHP 7.4 preload concept for Laravel.
Macros in Laravel
Unit testing in Laravel
Chatbot development (laravel + botman)
Laravel Core Adventures: Accessors & Mutators
Taylor Podcast Laravel Snippet # 14 - Laravel Live UK, whereHasMorph, laravel / ui, front-end authorization, performance, Lumen.
Yii
- cebe / yii2-app-api - Yii2 application template for quickly creating APIs based on OpenAPI specs.
Async php
Writing a RESTful API using ReactPHP: Plans and First Steps , What is a RESTful API?
Five Minute PHP # 5 - Away Sergey Zhuk talks about asynchronous PHP and ReactPHP. You can now listen to podcasts on YouTube .
Learning Materials
- PHP Wishlist - A good selection of features that I would like to see in PHP.
- Maybe you do not need a query bus
Mutation testing: testing tests
Logging in a distributed php application
PHP generics today (well, almost) - A few more examples of using generics in a post about implementation in PHPStan .
Haxe and PHP: static typing, arrow functions, metaprogramming and much more.
Pure PHP code - Software development principles taken from Robert Martin's Clean Code book and adapted for PHP.
Video from Dutch PHP Conference 2019
Video from PHPfwdays 2019
Thanks for attention!
If you notice a mistake or inaccuracy - please inform me in PM .
Questions and suggestions write to mail or twitter .
More news and comments on the PHP Digest Telegram Channel .
Send link
Search links for all digests
← Previous release: PHP Digest No. 158