PHP Annotated – October 2019
Greetings everyone,
It’s time for our October edition of PHP Annotated! Get the latest on PHP 7.4.0 RC 3, GitHub dependency graph support for PHP, upgrading PSR standards, RFCs from PHP Internals, and the Coordinating PHP project. We’ll share links for Laravel and Symfony, useful tools, videos, podcasts, and a whole lot more!
⚡️ News & Releases
- GitHub announced Dependency graph support for PHP repositories with Composer dependencies – composer.json files will be automatically analyzed for vulnerable dependencies, and repos will receive corresponding pull-requests.
- Upgrading PSR interface. PHP-FIG wants your help to modernize PSRs! – PHP-FIG proposes a gradual approach to adding return types and parameter type declarations to existing PSR standards. Reach out to PHP-FIG by sending your feedback via the form!
- PHP 7.4.0 RC3 – Another RC has been delivered according to schedule. Only 3 more RCs are left before the official PHP 7.4 release! Meanwhile, you’re welcome to read the manual Migrating from PHP 7.3.x to PHP 7.4.x and help with testing.
- PHP 7.3.10, PHP 7.2.23 – All users are encouraged to take advantage of these security updates.
🐘 PHP Internals
- [RFC] Object Initializer – In this thorough document, the new syntax for quick object initialization has been proposed:
class Car { public int $yearOfProduction; public string $vin; } $car = new Car { yearOfProduction = 2019, vin = "1FTFW1CVXAFD54385", }; $car = new Car { yearOfProduction = 2019, }; // throws RuntimeException: Initialization of Car class object failed due to missing required properties
Read about the proposal briefly in the author’s blogpost or listen to the podcast and take in all details in 🔈 PHP Internals News #30.
- [RFC] Reclassifying engine warnings – Existing warnings and notices in the engine have been revisited, and according to the voting results we’ll have the following in PHP 8.0:
• Undefined variables: now will throw a Warning.
• Undefined array index: Warning.
• Division by zero: will throw an Exception, and a newfdiv()
function will be added which allows division by zero.
• Invalid argument supplied for foreach(): Warning.
• All other changes passed the vote and were accepted.
Find out more in the podcast 🔈 PHP Internals News #29 with Nikita Popov. - PHP project coordination – While Internals again stirred up quite a bit of drama, some good things also happened. Dan Ackroyd created a document, where he described all the current discussions and tasks. If you’d like to contribute to the PHP project, this can be a great starting point.
🛠 Tools
- cycle/orm – This great PHP DataMapper ORM and Data Modelling Engine can be used in classic and long-running PHP applications, and in ActiveRecord manner too. Excellent documentation is available.
- ssx/skrub – A package to remove junk from Composer installations and trim build sizes.
- squizlabs/PHP_CodeSniffer 3.5.0 – Now with complete PSR-12 standard support.
- voku/portable-ascii – Performance-optimized (ASCII) string functions for PHP.
- infection/infection 0.14.0 – A framework for mutation testing in PHP. The new version adds 3 mutators, and has better performance, decreased memory consumption, and other improvements.
- solodkiy/mysql-error-parser – A package for parsing MySQL errors.
- alecrabbit/php-console-spinner – Nice CLI spinners.
Symfony
- API Platform 2.5 – Revamped Admin, new API testing tool, Next.js, and Quasar app generators, PATCH and JSON Schema support, and improved support for OpenAPI and GraphQL.
- shopsys/http-smoke-testing – Simple HTTP smoke-testing for your Symfony application.
- The Symfony Framework Best Practices are now all in one place.
- Symfony adds a String component, an OO way of dealing with strings.
Laravel
- spatie/laravel-model-states – The package adds state support to models. It combines concepts from the state pattern and state machines.
- Hunternnm/laravel-roadrunner – A simple bridge to run Laravel with RoadRunner.
- envant/fireable – An elegant way to trigger Laravel events based on attribute changes.
- Laravel with docker-compose.
- Introducing “ddd” – a new global helper in Laravel 6.
- Inertia.js and Livewire: a high-level comparison.
- 🎥 Cool streams from Garry Hockin on writing a deck-builder game with Laravel and React.js.
- 🎥 On testing Laravel with Jason McCreary.
- 🎥 Laracasts: Laravel 6 From Scratch.
🌀 Async PHP
- seregazhuk/php-watcher – A package to automatically restart a PHP application once the source code changes. Can be very useful for developing long-running PHP applications.
- 🎥 Creating a RESTful API with ReactPHP: Uploading Images, and Serving Static Files.
- clue/reactphp-docker – Async client for the Docker Engine API. Introductory post.
💡 Misc
- Matthias Noback: Using phploc for a quick code quality estimation, Part 2.
- doganoo/PHPAlgorithms – A collection of common algorithms based on “Cracking the Coding Interview” implemented in PHP.
- Most Popular PHP Magic Methods.
- A Detailed Explanation of Abstraction in Software Development.
- Bootstrapping a CLI PHP application in Vanilla PHP.
- gabrielrcouto/awesome-php-ffi – PHP FFI examples and use cases.
- More than RCE – Some different ways that an attacker can exploit an
unserialize()
vulnerability.
🔈 Podcasts
- 🎥 Derick Rethans streams Hacking on Xdebug – If you use Xdebug, consider supporting Derick on Patreon. If you are not using Xdebug… well, you are probably working way too hard.
- 🔈 PHP Internals News #28 – With Andreas Heigl on moving PHP documentation from SVN to Git.
- 🔈 PHP Internals News #27 – With Nikita Popov оn the help request for adding type declaration to builtin functions.
- 🔈 Voices of the ElePHPant: It’s the Booze Talking: PHP, the next 25.
💬 Community
- ElePHPant.me – A website to help trade ElePHPants.
Thanks for reading!
If you have any interesting or useful links to share via PHP Annotated, leave a comment on this post or tweet me.
Your JetBrains PhpStorm Team
The Drive to Develop
Prev post PhpStorm 2019.3 EAP #4php[world], Bulgaria PHP, PHP.BARCELONA, SymfonyCon – Cool Events to Go to This Fall Next post