Wow, where did 2013 go? At Inviqa, it was a busy year; we opened new offices in Edinburgh, Leeds and Manchester as well as expanding our existing Liverpool office. Rather than recruiting people and moving them to either London or Sheffield, we built offices around the people we wanted to work with to ensure access to the best PHP talent available. The entire IT industry is continuing to be buoyant and it is clear that the user base for digital solutions is growing at a huge rate. With each new device and platform that technologies vendors deliver there are new opportunities to use new and existing web technologies to deliver true value to customers, making PHP as relevant as ever in today’s enterprise offerings.
We thought we’d take the opportunity to look at the current landscape and make some predictions for what we expect to see in the year ahead, as well as reviewing last year’s predictions.
Were we right last year?
Twelve months ago, we made a series of predictions, so how accurate were we?
We predicted it last year (and indeed the year before that), and this year we did make steps towards the goal of framework convergence. The PHP Framework Interoperability Group is making a great deal of progress, however the biggest area where we see convergence is in the modules people are creating. There are still new modules that are very tightly coupled to a single framework, but many developers are creating code that is decoupled from the framework and can be used anywhere. Whether your framework is Symfony, Zend, Laravel, or any of the others, it is an implementation detail and as such your application code, the domain you are modelling, should not be coupled to it.
Content as a Service
We may have missed the mark with this one, as we have not seen services appearing and getting a great deal of coverage. However Inviqa has worked on a number of projects where this is a problem being addressed so it does seem as if there is space for this type of service.
Dependency Injection Containers Mark 2
The containers remain the same which is good because they were sound, but how they were being used was a little naive. A year later, there are much better examples of how to use containers appearing in blogs and articles on best practices. We are definitely seeing a much greater use of correct composition, with dependencies managed by a container being injected into the constructor with correct type hinting. This removes the coupling between the application and the DIC (Dependency Injection Container).
BDD with PHPSpec and Behat
“XUnit style testing frameworks seem to be losing favour within the community and the adoption of Spec frameworks and Behaviour Driven Development is set to increase in 2013.”
This prediction caused a great deal of debate and comment. XUnit frameworks are still being used and will continue to be used. However we have seen a number of projects adopt PHPSpec and Behat. Very few PHP conferences did not have at least one presentation covering these tools. This has sparked a great deal of interest and we have seen these tools used with great success on Inviqa’s own projects. Also, where we have been working with clients and their internal teams, we have found them able to pick up and work with TDD and BDD tools much more quickly than with XUnit frameworks.
Use and Misuse of Traits
There have not been many projects adopting traits so far, so last year we were a little early with this prediction. PHP 5.3 now has >50% of PHP 5 market share but with PHP 5.2 at 33%, adoption is slow. Many projects and framework maintainers have not yet been able to drop support for PHP 5.3. This has effectively restricted the adoption and use of traits.
Changes in PHP for 2013
PHP 5.5 was released during 2013 and the year ended with the 5.5.6 release in November. PHP 5.5 brings with it the integration of Zend Opcache into the core to replace APC (the previous de facto standard). Zend made the product available and compatible with the recent releases. PHP 5.5 also brings with it other features such as a password hashing API, simplifying the work needed to ensure our applications remain secure for brute force attacks and other exploits.
Generators are the latest syntactic sugar to come to the language. Generators allow you to suspend your code execution and resume later within the scope of the generator. Functions in PHP will execute to completion at the end of the function body or end with a return statement. Generators are different; your code can yield a value to your calling scope and then resume later, picking up where it left off. This can be especially useful for use with iterators and processing sets of data.
PHP 5.3 was considered end of life as of March 2013 and is now only being maintained with critical updates and it is strongly recommended that you upgrade to PHP 5.4.
PHP in the Community
PHPNE made its mark on the conference schedule during 2013 and looks like it will become a calendar staple through 2014. PHPUK and PHPNW continue to grow and the schedules are getting better and better, giving us and our communities access to some of the best speakers and topics available from around the world.
Open Source Projects
Laravel is causing a lot of noise and debate it seems and regardless of your thoughts on it’s approach it is a bold re-think of how to deliver a framework and focuses on the developers use cases. Laravel brings concepts from other component based frameworks such a .Net and provides the ability to build applications from these components. This is not unique amongst the latest generation of PHP frameworks but Laravel’s approach is uniquely different.
There is lots of documentation for PHP on various sites and some of it is of great quality, however some of it really is not! One of the greatest sources of information is PHP the right way, which is is quickly becoming the recommended way to learn how to write good PHP.
Predictions for 2014
Now we’d like to make some predictions for the changes arriving in the year ahead.
Following our earlier observations we predict that for 2014 module maintainers will stop purely building modules for Symfony, Zend Framework or other such specifics. They will instead build a module that provides the functionality and provide adapters to use the module within the chosen framework being used on the project.
Our hope is that this will also feed down into development teams on projects, who will also start to treat their chosen framework as an implementation detail and build their projects in such a way that the framework can be upgraded or replaced without having to have a full rewrite of the application.
Head over to http://www.php-fig.org/ to see all the existing defined standards. There is currently a proposed PSR-6 standard to unify caching so that cache-aware libraries can be created and integrate into existing frameworks and systems without the need for custom development.
We expect to see more PSR be defined during 2014, this is a very open group so if you have suggestions then you should join the discussion or submit a pull request.
Increased Use of PHPSpec and Behat
During 2014 we again expect to see more and more projects adopting BDD using PHPSpec and Behat to develop software with much greater focus on business value and the external behaviour. Projects spending much more time involved in designing the code than on implementation and validation of functionality. If you would like to learn about these concepts in greater detail then maybe consider coming along to one of our TDD immersion days.
Use and Misuse of Traits
This is on our list for another year; once framework and library developers stop supporting PHP 5.3 they will start to make use of traits. We anticipate that this will result in a great deal of code deletion from frameworks as multiple horizontal inheritance will allow a lot of boilerplate code (for example from iterators) to be removed and placed into traits.
During 2014 an early release of PHP 5.6 is expected. You can keep up with which RFCs are currently implemented at https://wiki.php.net/rfc#php_56.
More Companion Languages
Some people often describe themselves as Symfony developers, Zend Framework developers or Drupal developers. 2014 is the year to start thinking of yourself as a developer.
Now it’s your turn: what do you think was the biggest thing to happen in PHP during 2013? 2014 looks like another great year for PHP and for the community, what do you think will happen? Leave us a comment and let us know your predictions – we wish you all the best for the year ahead, whatever it holds!
- Alistair Stead
- Ben Longden