PHP Digest No. 158 (June 3-17, 2019)
Fresh selection with links to news and materials. In the release: PHP 7.4.0 alpha 1, DevConfX, accepted and new RFCs from PHP Internals, a portion of useful tools, and much more.
Enjoy reading!
News and Releases
- PHP 7.4.0 alpha 1 - The first alpha version of the new PHP branch has been released! Ahead of a six-month testing cycle , the final release is expected in late November.
The number of new features is impressive: typed properties , arrow functions , FFI, preload and much more! A list of all changes to the UPGRADING document .
An overview of new features can be found in the Habra translation New in PHP 7.4 or in a report by Nikita Popov on PHP Russia . - DevConf 2019 (Moscow, June 21) - The tenth anniversary DevConf. By tradition, reports are selected by vote. Listen to the overview of submitted applications in the podcast Five-Minute PHP # 54 .
PHP internals
- [RFC] Allow throwing exceptions from __toString () - Offer accepted unanimously.
- [RFC] Numeric Literal Separator - The proposal crossed the threshold for voting, and so in PHP 7.4 it will be possible to use the underscore as a separator in numbers:
$i = 197_823_459; // 197823459
- [RFC] Nullsafe Calls - An old proposal is being discussed again at Internals. It considers the possibility of adding a new operator
?->
that would allow making safe chains of method calls, in case the return value can benull
:$o?->mayFail1()?->mayFail2()?->mayFail3()?->mayFail4();
There is a similar offer in ECMAScript , but in Hack this feature is already implemented . - [RFC] Alternative “use” syntax for Closures - The author of the proposal considers the use syntax in closures not very convenient and suggests transferring it to the function body:Hidden text
// Так сейчас $closure = function ( ArgumentType $argument1, ArgumentType $argument2, ArgumentType $argument3, ArgumentType $argument4 ) use ($importVariable1, &$importVariable2, $importVariable3, &$importVariable4): ReturnType { // ... }; // Предлагается вот так $closure = function ( ArgumentType $argument1, ArgumentType $argument2, ArgumentType $argument3, ArgumentType $argument4 ): ReturnType { use $importVariable1, &$importVariable2; use $importVariable3, &$importVariable4; // ... };
- PHP Internals News # 13 - Sara Goleman (release manager PHP 7.2) and Derick Rethans (PHP 7.4) talk about release management.
- PHP Internals News # 14 - With Nikita Popov on exceptions in __toString ().
Instruments
- badoo / liveprof - Application performance monitoring tool. On Habré there was a post about him and you can see the demo .
- BrainMaestro / composer-git-hooks - Manage Git hooks from composer.json.
- hirak / prestissimo - Composer plugin for downloading packages in parallel. Significantly speeds up the installation of dependencies.
- ronanguilloux / IsoCodes - Library for validating various standard codes: postal codes (zip) of all countries, phone numbers, credit cards, national identification codes and others.
- zetrider / BotAuth - Authentication using bots on social networks. Post in support.
Symfony
- Symfony Week # 650 (June 10-16, 2019)
- Symfony CLI - New Local Development Tool
Laravel
- illuminatech / config - Transfer Laravel configs to the database.
- pipe-dream / laravel - Allows you to describe entities in a text file and generate an application skeleton based on it. Video review .
- spatie / laravel-webhook-server , spatie / laravel-webhook-client - A couple of simple packages for quick start with webhooks.
- Analysis of the Laravel service container by Matthias Noback, an expert at Zend / Symfony.
- Refactoring in Actions
- 40 additional validation rules for Laravel
- Laravel Dries Vints core developer shows how he maintains Laravel .
Yii
- Community extension collective - An initiative to create an organization to develop and support high-quality extensions for Yii. That is something like thephpleague .
- Interview with Alexander Makarov, Yii core team
- We use Yii2. We are writing another CMS or an attempt to significantly speed up development with minimal overhead
Security
- MyBB <= 1.8.20: From Stored XSS to RCE - Analysis of two critical vulnerabilities that allowed to take control of the forum.
- WordPress Critical Vulnerability admin-ajax.php
Learning Materials
- Generics in PHP - What is it and why are they needed + an overview of implementations in Psalm / Phan.
- Always relevant question: Why operations with float are not exact and what to do with it in PHP -
0.1 + 0.2 === 0.30000000000000004
- Nuances and features of isset ()
- How to mix final classes - In a post, the author recommends dg / bypass-finals .
- About what is Explicit architecture - As an example, the author refactored the Symfony hgraca / explicit-architecture-php demo application .
- About tests and types
- DB Cursors in Doctrine
- PHP 2019: Better Than You Think About It
- PHP Мeetup # 27, Minsk
- Best PHP Russia 2019 reports
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. 157