Our April issue of PHP Annotated Monthly delivers updates on PHP, frameworks, tools, tips for coding, HHVM, news on RFCs for PHP 7, community, and much more. Read this month’s digest curated by Mikhail Vink, PhpStorm Product Marketing Manager.
All three currently supported versions of PHP got updated (with versions 5.6.7, 5.5.23 and 5.4.39 released). Updates are focused on bug-fixes, including three security issues; the changelog is available as usual.
We’ve featured information on the highly-debated Scalar Type Declarations RFC for a few months in a row, and now we are glad to announce that after many discussions in the community it’s been finally accepted for PHP 7. The relevant branch is already merged to PHP 7 core, which means that we are getting four new type declarations for scalar types: int, float, string and bool. Apart from that, a new optional per-file directive, declare(strict_types=1); is introduced, which makes all function calls and return statements within a file have “strict” type-checking for scalar type declarations. Er Galvao Abbott shares his thoughts on the matter in his post PHP7: More strict! (but only if you want it to be).
Further on the topic of recent RFCs, anonymous classes are coming in PHP 7, as well as support for return in generators, generator delegation, and more. Make sure to follow PHP RFC Watch by Benjamin Eberlei if you are interested in timely PHP RFCs updates.
Talking about PHP 7, Phil Sturgeon made a great overview of PHP 7 features, as it hits feature freeze (some of those features are already decided, some are still in voting by the time the post’s been published). One more notable overview of what to expect in PHP 7 (and 2nd part) is published by Davey Shafik along with call-to-actions: test your code with PHP 7, help GOPHP7-EXT project, and write documentation. Zend published an infographics, 5 things you must know about PHP 7. And if you start your daily routine with checking whether PHP 7 is already released, this service is meant to tell you just that.
As for testing your current code with PHP 7, check Rasmus Lerdorf’s updated php7dev Vagrant box image, which is pre-configured for testing PHP apps and developing extensions across many versions of PHP.
Julien Pauli in his zoom on PHP objects and classes blog post gives a deep PHP object model internal design tour to provide a better glance of what happens when you manipulate objects in PHP, with a goal to learn how to master what happens on the low level, to make better use of the language.
Two interesting blog posts were published by Christopher Pitt, one on reactive PHP events (Distributed. Asynchronous. Magical), and another on co-operative PHP multitasking (When is an array like an adventure?). Both are quite deep and well worth reading.
Frameworks and Tools
The highlight of the month in this category is definitely Best PHP Framework for 2015 Survey Results by SitePoint. With about 7,800 entries, it gives an interesting statistics on frameworks of preference, showing major leadership of Laravel and Symfony2. Breakdown by countries also worth exploring, and all the survey data is available for download.
Many frameworks and CMSs have been updated, including Symfony 2.6.6, Symfony 2.5.11, Symfony 2.3.27, Zend Framework 2.4.0, CakePHP 3.0.0, WordPress 4.2 Beta 4, Drupal 6.35, Drupal 7.36, and Joomla 3.4.1.
Symfony’s got a new installer, a small PHP application that requires one-time installation and allows you to create multiple new projects based on any Symfony version. The traditional Symfony installation based on Composer has been deprecated, and even though you can still use Composer to install Symfony, the new Symfony Installer is the only recommended way to install Symfony.
More and more news are coming from Derick Rethans, author of Xdebug. He overviews new features and improvements available in the recently-released Xdebug 2.3 in a series of great blog posts, such as Shared Secret to Enable Tracing or Profiling, Improvements to Tracing, Improvements to Debugging, Munging Errors, and more in his blog.
Sebastian Bergmann shares news that PHPUnit 4.6.0 has been released, a new version of programmer-oriented testing framework for PHP. PHPUnit can now optionally mark a test as risky when global variables, super-global variables, or static attributes in user-defined classes are modified during the execution of a test. The release also features a lot of bug-fixes and major change: the PHAR build of PHPUnit no longer uses an autoloader to load PHPUnit’s own classes and instead statically loads all classes on startup.
In his latest post, Anthony Ferrara shares thoughts on the design of APIs, talking about designing APIs specifically for the target user and designing APIs to require the least amount of target-user knowledge as possible. He names moderation as a key thing here and asks readers to try to keep the target user in mind when designing APIs (even functions/methods).
Of course there’s lots more news around. Ian M. Jones publishes A Developer’s Guide to Contributing to WordPress Core. Piotr Pasich blogs about ant, composer and code quality tools. Jeremy Mikola together with mongoDB calls for feedback on the new PHP and HHVM drivers. Coen Jacobs says that updating PHP is everyone’s responsibility, as framework / CMS core teams can’t take care of all the aspects and all the hosting companies, which is why Coen created WPupdatePHP, a library to be bundled with WordPress plugins to enforce users to upgrade to PHP 5.4 hosting.
More news from the PHP ecosystem can be found in PHPDeveloper.org and other community resources.
Community and more
News on the PSR-7 (HTTP Message Interfaces) were evolving very fast. First, it’s been announced that voting is started (read the full blog post, PSR-7 is in Voting Stage!, by Matthew Weier O’Phinney). And just a week later it was cancelled due to the desire to improve and clarify the spec before approving it.
A short update on the HHVM: as planned, HHVM 3.6.0 was announced March 11, 2015, representing the second official LTS release. This release comes with many new Async features available by default, including AsyncMySQL and MCRouter (memcache) support. Combined with existing support for asynchronous cURL, applications are now ready to deeply parallelize many common forms of costly data access.
Etsy is sharing their experience of scaling their API traffic capacity 20 times. They’ve launched many efforts to meet the challenge, including a migration to HHVM after it showed a promising increase in throughput. There were many surprises and interesting details, so read the full article by Dan Miller for insights.
Josh Lockhart has published a new book, Modern PHP: New Features and Good Practices, talking about how PHP has become a full-featured, mature language with object-orientation, namespaces, and a growing collection of reusable component libraries. Some reviews are already available on Amazon.
There are a couple more books out this month: The Grumpy Little Book Of Hack by Chris Hartjes (a pocket guide for using HHVM and Hack on legacy PHP code bases), and Iterating PHP Iterators by Cal Evans (a book that will help you learn to use the power tools built into the PHP language to write better and faster code).
Fortrabbit publishes 70 PHPeople, a list of 70 PHP leaders, and there are definitely many more awesome PHP devs out there, so the list will be continued. Check out the list and follow the heroes on Twitter or GitHub.
In his latest why I support the league blog post, Rafael Dohms talks about the reasons for this project to exist (such as imposed quality, curated list, reduced author fragility, extended reach, reduced duplication, and more). The League of Extraordinary Packages is a group of developers who have banded together to build solid, well tested PHP packages using modern coding standards.
Khayrattee Wasseem (@7php) interviews Yitzchok Willroth on #BiggestLoserPHP15 challenge and talking about the PHP community being also about promoting lifestyle changes & nurturing healthy habits.
Following the unfortunate events, Drupal Association creates the Aaron Winborn Award to honor community members who exhibit the incredible kindness, integrity, and above-and-beyond commitment to the community.
Did you find an interesting read? Have news to share? Or just want to comment on this post? We’d love to hear from you in the comments below. Feel free to reach out to our PhpStorm product marketing manager @mikhail_vink on Twitter.
See you in May!
Develop with pleasure!
– JetBrains PhpStorm Team