PHP Annotated Monthly – June 2015

PHP Annotated MonthlyOur June issue of PHP Annotated Monthly is here, congratulating PHP community on PHP’s 20th birthday and bringing you updates on PHP, frameworks, tools, tips for coding, community matters, and more. Read this month’s digest curated by Mikhail Vink, PhpStorm Product Marketing Manager.

PHP

PHP got its monthly update with versions 5.6.9, 5.5.25, and 5.4.41 released. Updates are focused on bug-fixes; the changelog is available as usual.

The next version of PHP, PHP 7.0, is approaching, and now has its own defined timetable with the first Alpha version to be released on 11th June, 2015, and a final release being currently scheduled for 12th November, 2015. All the RFCs accepted for PHP 7.0 are now provided on the relevant wiki page.

The latest major news from the language development world is that PSR-7 standard (HTTP Message Interfaces) has been accepted (read more about the PSR in the initial standard spec). The standard is already used in Symfony (and Laravel got it from there), Guzzle, Zend Framework (via zend-diactoros), and more. PSR-7 has huge potential for interoperability and standardization across all the PHP. This is especially true for middleware: functions that hook into the request-response process. In the future, a middleware written around these new interfaces could be used in any framework.

Shortly after PSR-7 has been announced, Paul M. Jones released Radar, a PSR-7 compliant Action-Domain-Responder (ADR) system. While it may look like a micro-framework, it is more like a wrapper around the real core of the application domain. He’s also explained the concept in his blog post Radar: Answering Questions, and New Middleware. On a non-related topic, Paul’s also talked about semantic versioning in another blog post (comments are noteworthy as well).

Getting back to PHP 7, Davey Shafik gives a good overview of upcoming changes in his slides what to expect when you’re expecting PHP 7 presented at phpDay Italy conference. Lorna Mitchell talks about stability (including reasons for PHP 7 to be stable and reliable), and painless upgrades to PHP 7 for many projects in her post PHP 7: easiest upgrade yetLucas Corbeaux gives a short overview with lots of links on what’s going on around PHP 7 right now, many of which have been featured in our previous editions of PHP Annotated Monthly.

Chris Cornutt shared an insight on PSR-9 and PSR-10 which were recently moved into master on the php-fig/standards repository, moving them along to the next step and to get the wider perspective of the main PHP-FIG group’s opinions on it. Chris provides a brief summary of those two standards.

Anthony Ferrara posted two great articles full of insights: one on tries and lexers, and another on prefix trees and parsers — we’d highly recommend to familiarize yourself with his thoughts and experiments.

Ross Tuck tells us how (and why) he uses traits in PHP. He writes about leverage vs. abstraction, parent classes, interfaces, and the advantages/disadvantages of using traits.

Marc Aube blogged about Specification design pattern, a software design pattern used to codify business rules that state something about an object. These simple predicates determine if an object’s state satisfies certain business criteria. They can then be combined to form composite specifications using logical operators. In another post, Marc shares an insight on choosing your project dependencies.

The importance of serializing API output is brought to our attention by Phil Sturgeon. Phil shows all the basics of serialization, and provides a list of tools to use, saying that API is not just a proxy for SQL commands, but it should be planned, considered and maintained carefully, and a simple change to your data store should not take down the entire network of applications and services.

Frameworks and Tools

Many major frameworks and CMSs have been updated this month: Symfony 2.7.0, Symfony 2.6.9, Symfony 2.5.12Symfony 2.3.30, Laravel 5.1Zend Framework 2.5.1, Zend Framework 1.2.13, CakePHP 2.6.7 & 3.0.6Drupal 8.0 beta 11, and others.

Symfony 2.7 is the new LTS version of Symfony, and it comes with more than 100 new features and enhancements (such as the new Asset component, new PHPUnit bridge, Propel bridge removed from Symfony Core, major performance improvements, and more). As mentioned earlier, 2.7 comes with an unexpected surprise, which is early built-in support for PSR-7. That works as of Symfony 2.3, without breaking backward compatibility.

Laravel 5.1 is the new LTS version of Laravel, which comes with the commands folder renamed to jobs, PSR-2, resolution of a service from blade, middleware parameters, broadcasting events, and many other features and improvements.

Speaking of news from the HHVM / Hack world, Davey Shafik published a slide deck from his PhpDay Italy’s talk Writing Faster PHP with HHVM and Hack, and that’s definitely a good resource for a quick overview. HHVM official blog features a new post Covariance, Contravariance, and super Type Constraints, where the recently enhanced generics in Hack are explained (they’ve been enhanced with two features: variance annotations and super type constraints). Ali Raza publishes a good article on PHP 7 vs HHVM competition listing good examples of real world HHVM usage, as well as some benchmarks.

The recent PHPUnit release announcement by Sebastian Bergmann brings news on dropping support for PHP 5.3/5.4/5.5 in PHPUnit 5 (which is planned to be released in October 2015), and informs us that functionality marked as deprecated in PHPUnit 4 will be removed in PHPUnit 5. And getting back to the current version, PHPUnit 4.7 was released just a few days ago.

In the meantime, SitePoint’s Bruno Skvorc shares composer tips’n’tricks which might be worth exploring, especially if you’re just beginning to use the tool. Peter Petermann blogs his thoughts on how people actually use composer (among other issues, Peter mentions resources consumption, custom paths usage, ignoring semver, lack of tagging, and more). And if you’re already taking advantage of composer in your projects, you’ll enjoy looking at the packagist graph project, which helps you visualize package dependencies, shortest path between packages, and shortest path between two maintainers.

In other news, Matthew Weier O’Phinney writes about Splitting the ZF2 Components (that was one of the major goals towards Zend Framework 3: splitting the various components into their own git repositories). Josh Lockhart shares his insight on Docker for PHP Developers (efficient Nginx, PHP, and MySQL development environments with Docker). Stephen Heron talks about PHP in a JavaScript world,

Lorna Mitchell posts on the topic of Code Reviews: Before You Even Run The Code, and SecurityAffairs shares information on PHP hash comparison flaw being a possible risk for a million users.

Community and more

Did you know that June 8th is PHP’s birthday? Just yesterday PHP turned 20! On June 8th, 1995, Rasmus Lerdorf announced the release of PHP, and it has evolved since then. We on the PhpStorm team congratulate the entire PHP community on this proud anniversary!

Follow the twitter hashtag #20yearsofphp to look at how PHP community celebrated this date. Several PHP community members already shared their 20 years of PHP story. Read them from Ben Ramsey, Cal Evans, Rafael Dohms, Erika Heidi Reinaldo, Davey Shafik, Michelangelo van DamMatthew Weier O’Phinney, Chris Hartjes, Derick Rethans, Christian Wenz, Pascal Martin (FR), Stephan Hochdörfer, Joe Watkins, Wim Godden, Mark Railton, and others (alternatively there is a list maintained by phpdeveloper.org). Share your story as well with hashtag #20yearsofphp! There is also a timeline of PHP development published by Peter Kokot.

Ben Ramsey talks about his failed attempts at soft skill talks sharing important thoughts on keynote talks and soft skills talks in general. There is also a very interesting thread of comments from other PHP community members which you don’t want to miss.

Michelangelo van Dam published a gist with upcoming 2015 fall conferences list — make sure to visit at least some of them.

Taylor Otwell, a creator of Laravel framework and other projects, has been interviewed about open source software and making the transition to entrepreneurship.

A new PHP logo has been proposed by Vincent Pontier, designer of original elePHPant mascot. What do you think about the style? Speaking of mascots, the great ancestor of the PHP ElePHPant, the PHP Woolly Mammoth, has been immortalized as a 7″ Plush Toy by the TrueNorth PHP, and you can back it on kickstarter.

A short tour of PHP is given to us by Aniruddh Agarwal, where he talks about the learning curve of starting with PHP, as well as some history of PHP, and resources which might be useful while getting into language.

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 July!

Develop with pleasure!
– JetBrains PhpStorm Team


Get PhpStorm 8

image description