Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Fabien Potencier:
Symfony 4: Performance out of the Box
Dec 12, 2017 @ 13:48:07

In a quick post to his site Fabien Potencier (of Sensio Labs and the Symfony framework) has a post sharing some information around the performance of Symfony 4 and what kind of speed you can expect in your applications based on it.

Performance is an interesting and sensitive topic. Suffice to say that most projects should not care too much; modern PHP frameworks are fast enough for most use cases and projects. And PHP 7 performance improvements help a lot as well. But people like to compare frameworks, and I guess performance is one way to do so.

What about Symfony 4? During its development cycle, we did some nice performance optimizations: mainly to improve the router and container speed. But several non-related changes in Symfony 4 also help with performance... Your mileage may vary depending on your specific project of course.

He talks about some of the testing and evaluation that's already been done on "Hello world" script performance but points out that this isn't a very real world situation. He shares these metrics, however, to at least give a baseline to compare it against previous Symfony versions. The post also links to another resource that shares these and other benchmarks related to various PHP projects.

tagged: symfony4 performance symfony framework version benchmark

Link: http://fabien.potencier.org/symfony4-performance.html

Jerzy Zawadzki:
Symfony 4: New Hope
Dec 04, 2017 @ 11:16:56

In a new article to his Medium.com site Jerzy Zawadzki talks about why he things that Symfony 4 is "the new hope" for the framework. In the article he goes through the updates in their major version including code examples, commands and descriptions on each.

On November 30, 2017 new version of Symfony Framework has been released and it looks like core team followed the Star Wars numbering pattern, as 4th version is much better, leaving previous three behind as they look like ‘prequels’ now.

In this article, I will try to sum up all important changes made in Symfony 4, so if you are familiar with Symfony 3 and want to get known with new version? - ?this article is for YOU!

He talks about the changes in developer experience that come along with version 4 and updates to the installation process to make it even simpler. He lists out the packages that are installed in this new version and what's included by default. He then walks through the addition of other packages and tools, pulled in as custom options. Finally he talks about bundles, their use in Symfony 4 and the changes in how applications are structured based on their use.

tagged: symfony symfony4 changes framework version release feature

Link: https://medium.com/@zawadzki.jerzy/symfony-4-new-hope-dbf99dde91d8

PHP.net:
PHP 7.2.0 Released
Nov 30, 2017 @ 11:20:32

The PHP development group has a post on the main PHP.net site officially announcing the availability of the latest major version in the PHP 7.x series: PHP 7.2.0.

The PHP development team announces the immediate availability of PHP 7.2.0. This release marks the second feature update to the PHP 7 series.

There's a number of new features and changes that come with this release including counting of non-countable objects, the Object typehint, the removal of mcrypt and the new libsodium extension. You can view the full list of changes and bug fixes in the Changelog.

Downloads are available in the usual places: the main downloads page for the source packages and windows.php.net for the Windows binaries. Additionally a migration guide has been posted to help with migrating to this new version.

tagged: php72 release language version update migration

Link: http://php.net/archive/2017.php#id2017-11-30-1

Exakat Blog:
Get ready for PHP 7.2
Nov 20, 2017 @ 09:56:21

With the final release of PHP 7.2 coming on the horizon the Exakat blog wants to be sure you and your code are prepared for some of the changes. In this new post they share things to change and improvements to expect in this latest version of the PHP language.

PHP 7.2 is around the corner, and shall be out soon, thanks to the hard work of @RemiCollet), Sara Golemon (@saramg) and countless others that run tests and submit bug reports. PHP 7.2 is already RC6, and the documentation has even been updated : it is high time to get ready for PHP 7.2.

We have been hard at work, at @Exakat, to prepare the migration analysis. This is our take on this upcoming task.

He's broken the changes coming down into a few categories based on the actions required and what you can do to prepare: Know, Lint, Static (Analysis), Unit testing and Logging. A chart is then included showing each of the changes, which category they fall into and links to more information about them and what has been updated (or added).

tagged: php72 preparation lint staticanalysis unittest logging update version language

Link: https://www.exakat.io/get-ready-php-7-2/

Jordi Boggiano:
PHP Versions Stats - 2017.2 Edition
Nov 13, 2017 @ 11:51:01

Jordi Boggiano is back with the latest round of his PHP version statistics as gathered from the information provided by the Composer package management tool for PHP.

It's stats o'clock! See 2014, 2015, 2016.1, 2016.2 and 2017.1 for previous similar posts.

A quick note on methodology, because all these stats are imperfect as they just sample some subset of the PHP user base. I look in the packagist.org logs of the last month for Composer installs done by someone. Composer sends the PHP version it is running with in its User-Agent header, so I can use that to see which PHP versions people are using Composer with.

He then shares the results of the statistics including the total number of users for each version of the language and the difference in just the last 6-7 months. PHP 7.1 has pulled out as a front-runner with PHP 7.0 coming in closely after. He also shows some historical data showing the decline of the 5.x versions and the rise of 7.x versions over the past years. The post ends with information about the percentage of requirements in packages with 5.6 taking the lead but not by much.

tagged: composer language version usage statistics 2017

Link: https://seld.be/notes/php-versions-stats-2017-2-edition

Adam Culp:
Stop the pain, get to PHP 7
Oct 09, 2017 @ 11:21:24

In a post to his site Adam Culp makes a recommendation to all of those running their applications on older versions of the language: stop the pain, get to PHP7.

So, now you may be asking, “What does [my football story] have to do with upgrading to PHP version 7?” The answer, because many are letting the pain of moving to PHP 7 prevent them from experiencing the pleasure and rewards.

PHP version 7.0 was released almost 2 years ago. (1 year 10 months to be exact.) And many are still running PHP version 5.something. As a matter of fact, PHP version 7.0 is already going to run out of active community support in only 1 month and will only receive security fixes for another year after that.

He then talks about some of the pains that usually come with upgrading, especially when the jump is a relatively large one (like from the 5.x world). He mentions the acclamation of limitations that is all too easy to get used to with older versions. He also covers some of the pleasures that come with PHP 7 including one of the most major ones: the instance performance boost it gives most applications.

tagged: php7 upgrade pain migrate php5 version language

Link: http://www.geekyboy.com/archives/1376

Kinsta Blog:
What’s New in PHP 7.2
Oct 03, 2017 @ 10:51:03

On the Kinsta blog there's a new tutorial by Carlo Daniele with a look ahead at the next version of the PHP language - PHP 7.2 - and what you can expect.

Currently in RC3, PHP 7.2 is planned to be released on November 30. The new release is coming with new features, functions, and improvements that will allow us to write better code. In this post, I will introduce some of the most interesting language features coming with PHP 7.2.

You can see the full list of upcoming changes on the Requests For Comments page.

Their list covers a number of the updates coming in this version including:

  • Argument type declarations [for objects]
  • Parameter Type Widening
  • Trailing commas in list syntax
  • Several security improvements

They also cover some of the functionality that's being deprecated and what kind of impact this new version will have on WordPress users.

tagged: php72 upcoming version php72rc3 feature deprecation wordpress

Link: https://kinsta.com/blog/php-7-2/

Facile.it Engineering Blog:
How to gradually upgrade toward PHPUnit 6 with namespaced classes
Sep 13, 2017 @ 11:56:03

On the Facile.it Engineering blog there's a recent post sharing some tips on how to gradually upgrade your PHPUnit tests to work with version 6 of the popular PHP unit testing tool.

In the latest months I wrote multiple times, in different projects, code migrating PHPUnit toward major version 6. This upgrade is harder than the previous one, since in this version it was introduced a big breaking change: all classes got (finally!) namespaced.

This means that any usage of those classes in your project needs to be updated. [...] In this article I will explain which steps I applied during those migrations, highlighting the most frequent hiccups.

He then start with "the easy one" to take care of the refactor: updating tests to replace the "PHPUnit_*" classes with the namespaced versions. With those out of the way, he talks about "the bumpy one" to handle: modifying test listeners to work with the new PHPUnit structure. Once these are taken care of you can then make the move up to PHPUnit 6 and PHP 7 (if you're not there already) full time.

tagged: phpunit upgrade version unittest phpunit6 php7 tutorial

Link: https://engineering.facile.it/blog/eng/phpunit-upgrade-namespace/

Laravel News:
Track Laravel Model Changes with Laravel Auditing
Aug 04, 2017 @ 09:57:35

On the Laravel News site there's a post sharing a helpful package that can provide an audit trail for model changes, helping you automatically keep track of what changed when.

Laravel Auditing is a Laravel package that aims to make it easy to track eloquent model changes. The documentation describes Laravel Auditing as follows:

"This package will help you understand changes in your Eloquent models, by providing information about possible discrepancies and anomalies that could indicate business concerns or suspect activities.

Laravel Auditing allows you to keep a history of model changes by simply using a trait. Retrieving the audited data is straightforward, making it possible to display it in various ways."

The post talks about another use case for the package - handling versioning for records (like auto-saving a blog post periodically). An example is included showing how to implement the package on the model, show an audit history and a Blade view to show the results.

tagged: laravel model audit package introduction version

Link: https://laravel-news.com/laravel-auditing-package

Stovepipe Systems:
Immutability of Data
Jul 13, 2017 @ 10:51:22

On the Stovepipe Systems blog today Yannick de Lange has written up a post looking at data immutability and how using this concept can help improve your development and simplify data handling in your applications.

When dealing with enterprise software, your data is often the most valuable part. It contains all your customer information, contracts, invoices and much more. So what are you going to do to make sure the data is being dealt with correctly? A bug in your code can have a high impact on the integrity of your data. If the bug is causing unwanted changes in your data, fixing the damage might prove to be quite a big challenge.

With this post I would like to show how data immutability can help design a more robust system. One that is less susceptible to bugs that might make unwanted changes to your data.

He starts by talking about how immutability and data handling might seem like "a contradiction" but that it can, instead, be thought of as "versioning your data". He gives an example of an end date on a contract and how changing it directly leads to data loss. He then gets into an actual code example showing how to implement this data versioning. He starts by creating the basic "Contract" object but then refactors it into "versioned" types and how the changes would be tracked internally, updating with each change to the data instead of overwriting.

tagged: data immutability example tutorial version dataloss

Link: https://stovepipe.systems/post/immutability-of-data