PHP Annotated Monthly – June 2019
Greetings everyone,
Please welcome the June edition of PHP Annotated Monthly, with all the latest news and notable materials from the world of PHP. Read all about the PHP 7.4.0 alpha 1 release, Doctrine company, new and accepted proposals from PHP Internals, Laravel, Symfony, useful tools, and a whole lot more!
⚡️ News & Releases
- PHP 7.4.0 alpha 1 – The first alpha of a new interpreter version is available for testing. This effectively starts the 6-month pre-release phase; the GA is expected at the end of November.
The new additions look impressive: typed properties, arrow functions, FFI, preloading, and so much more! See the list of all changes in the UPGRADING doc. Get a nice overview of What’s new in PHP 7.4 in this write-up and from 🎥 Nikita Popov’s talk at PHP Russia. - After 10 years of developing Doctrine, the team has now created Doctrine Company, LLC in order to make it financially sustainable. You can now officially sponsor the project, request training or consulting, or participate in webinars.
- Bref, a tool for deploying and running serverless PHP apps, is now backed by null, the company
- PHP versions stats – 2019.1 – A traditional compilation of statistics based on the data that composer sends when connecting to packagist.org. Shows the use of new versions of PHP is growing, and the total share of all PHP 5.* is about 10%. Compare this to JetBrains’ The State of Developer Ecosystem 2019 survey results.
- PhpStorm 2019.2 EAP – The Early Access Program is in full swing, and you can already try out the new features: regexps autoinjection in PHP, PHP 7.4 support, finding duplicates on-the-fly in the editor, cURL syntax support in HTTP-client, EditorConfig out of the box with support for PhpStorm-specific options, PHPT support, and advanced code assistance for Shell Scripts.
🐘 PHP Internals
- [RFC] Allow throwing exceptions from __toString() – The proposal has been accepted unanimously. And there is one less PHP Sadness!
- [RFC] Numeric Literal Separator – The proposal has been accepted. In PHP 7.4 it will be possible to specify numerics with an underscore separator:
$i = 197_823_459; // 197823459
- [RFC] Nullsafe Calls – An old proposal was raised again. It considers adding a new operator
?->
, which will allow safe method call chains in the cases where one of the methods may return null:$o?->mayFail1()?->mayFail2()?->mayFail3()?->mayFail4();
ECMAScript has this also in a proposal, and Hack has implemented it already.
- [RFC] Alternative “use” syntax for Closures – This proposal attempts to improve
use
in closures by moving it to the function body:// This is how it looks now $closure = function ( ArgumentType $argument1, ArgumentType $argument2, ArgumentType $argument3, ArgumentType $argument4 ) use ($importVariable1, &$importVariable2, $importVariable3, &$importVariable4): ReturnType { // ... }; // This is proposed $closure = function ( ArgumentType $argument1, ArgumentType $argument2, ArgumentType $argument3, ArgumentType $argument4 ): ReturnType { use $importVariable1, &$importVariable2; use $importVariable3, &$importVariable4; // ... };
- 🔈 PHP Internals News #13 – Sara Goleman (RM of PHP 7.2) and Derick Rethans (PHP 7.4’s RM) talk about Release Management.
- 🔈 PHP Internals News #14 – With Nikita Popov on __toString() Exceptions.
🛠 Tools
- badoo/liveprof – A PHP performance monitoring tool. See the introductory post and live demo.
- remotelyliving/php-dns – A DNS abstraction for PHP that allows querying DNS records with different strategies.
- BrainMaestro/composer-git-hooks – Easily manage git hooks in your composer config.
- hirak/prestissimo – A composer plugin to download packages in parallel and increase the speed of the install.
- ronanguilloux/IsoCodes – Validators for the standards from ISO, such as international finance, public administration, book industry, phone numbers, and zip codes for many countries.
- terrylinooo/shieldon – Anti-scraping and online session control for your web application.
- goldspecdigital/oooas – This allows you to build OpenAPI spec using PHP classes, and then export the spec to JSON.
Symfony
- Symfony 4.3.0 – The release introduces new components HttpClient (cheat sheet), Mailer, and Mime as well as many other improvements described in this detailed blog series. Also, support of version 2.7 has ended.
- Deploying serverless Symfony apps on AWS Lambda with Bref
Laravel
- illuminatech/config – Manage a Laravel configuration by persistent storage.
- pipe-dream/laravel – This allows you to describe all the entities in a simple text file and then generate boilerplate code for Laravel applications rapidly. Demo.
- spatie/laravel-webhook-server, spatie/laravel-webhook-client – A couple of packages for quickly getting started with webhooks.
- Matthias Noback Learning Laravel – Observations, part 1: The service container
- Refactoring to actions
- 40 Additional Laravel Validation Rules
- 🎥 Stream on implementing a PR to spatie/laravel-newsletter. Also, see other streams by Jason McCreary.
- 🔈 Taylor’s Podcast Laravel Snippet #13 – On laravel/ui, monetizing open source, Laracon 2019.
- 🎥 Taylor Otwell’s Q&A session at Laravel Live UK 2019
- 🎥 Dries Vints demonstrates how he maintains Laravel
🚨 Security
- MyBB <= 1.8.20: From Stored XSS to RCE – Two critical vulnerabilities allow attackers to take over #MyBB boards with a malicious private message.
💡 Misc
- PHP Generics Today (almost)
- Tests and types
- GitHub Actions for PHP Developers
- A Look At PHP’s isset() – Some quirks and behaviors that are very much worth knowing about.
- Don’t just float, swim with the floating point – Why floats are imprecise and how to work around it in PHP.
0.1 + 0.2 === 0.30000000000000004
. - Global States: Why and How to Avoid Them
- How to Mock Final Classes in PHPUnit – Spoiler: the post suggests using dg/bypass-finals.
- Reflecting architecture and domain in code – The post explains what Explicit architecture is. See also hgraca/explicit-architecture-php – The Symfony Demo Application, refactored in Explicit Architecture style.
- PHP Framework Trends were updated with Doctrine packages statistics.
- 🎥 Structuring the Docker setup for PHP Projects
A group of #PHP developers is called an "array".
If they all work together, it's an "associative array". #dpc19
— Larry Garfield (@Crell) June 8, 2019
Thanks for reading!
If you have any interesting or useful links to share via PHP Annotated Monthly, leave a comment or drop me a message on Twitter.
Your JetBrains PhpStorm Team
The Drive to Develop