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

PHP.net:
PHP 7.1.3 Released
Mar 17, 2017 @ 11:17:21

The PHP.net site has posted an announcement about the latest release in the PHP 7.1.x series - PHP 7.1.3:

The PHP development team announces the immediate availability of PHP 7.1.3. Several bugs have been fixed. All PHP 7.1 users are encouraged to upgrade to this version.

Bugs fixed in this version include changes in core code, Apache support, GD image handling, OpenSSL changes and correcting bugs in the standard libraries. As always you can download this latest release either from the main PHP.net site (source) or from windows.php.net (Windows binaries).

tagged: language release bugfix php71

Link: http://php.net/index.php#id2017-03-16-2

PHP.net:
PHP 7.1.2 Released
Feb 20, 2017 @ 12:15:32

The official PHP.net site has announced the release of the latest version in the PHP 7.1.x series: PHP 7.1.2:

The PHP development team announces the immediate availability of PHP 7.1.2. Several bugs have been fixed. All PHP 7.1 users are encouraged to upgrade to this version.

Bugs fixed include changes for DOM handling, FastCGI, hashing (adding http://php.net/hash_hkdf function), MySQL, OpenSSL and a good number of other locations. You can view the Changelog for the complete list. As always you can get this latest version from the main downloads page (source release) or windows.php.net for the Windows binaries.

tagged: language version release php71 minor bugfix

Link: http://php.net/index.php#id2017-02-17-1

Sameer Borate:
Handling multiple exceptions in PHP 7.1
Feb 14, 2017 @ 09:40:16

Sameer Borate has a new post to his site today showing how you can handle multiple exceptions in PHP 7.1, the latest release in the PHP 7.x series.

Exception handling is one of the ways in which modern languages handle errors. PHP usually handles exception in a separate catch block for each different type of exception. Below is a example exception code that uses three custom exceptions ‘MyFooException’, ‘MyBarException’ and ‘MyBazException’ that is later handled in a ‘try’ block.

He includes a bit of code showing the "old way" of doing it with multiple catch statements, one for each type of exception. With PHP 7.1 however, you can collapse all of those down into a single catch statement and type hint each type you want caught (pipe delimited). This can make for much cleaner code and a lot less repetition in your error/exception handling.

tagged: multiple exception php71 try catch single tutorial

Link: http://www.codediesel.com/php/handling-multiple-exceptions-in-php-7-1/

Sameer Borate:
New features in PHP 7.1
Feb 13, 2017 @ 10:57:45

The PHP 7.1.x releases are some of the latest versions of the language. There's plenty of new features that came along with this new release. In this new post to his CodeDiesel blog Sameer Borate looks at some of these new features (including code snippets to illustrate).

The PHP development team announced PHP 7.1.0 on 01 Dec 2016. This release is the first point release in the 7.x series. There are a few features – like the void return type – which have been introduced. Below are a few new selected features in PHP 7.1.

In the post he covers:

  • void functions (return type)
  • nullable types
  • symmetric array destructuring
  • class constant visibility

For each, code samples are provided and some of the benefits (and limitations) that come along with them.

tagged: feature php71 void nullable array class constant summary

Link: http://www.codediesel.com/php/new-features-in-php-7-1/

PHP.net:
PHP 7.1.1 Released
Jan 19, 2017 @ 12:30:26

On the main PHP.net site they've posted the announcement today about the release of the latest version in the PHP 7.1.x series: PHP 7.1.1:

The PHP development team announces the immediate availability of PHP 7.1.1. Several bugs have been fixed. All PHP 7.1 users are encouraged to upgrade to this version.

Updated in this release are bugs in the language core, the CLI handling, namespacing with DOM and a few various security-related issues. You can find out about the rest of the changes and links to their respective bugs in the Changelog. As always, you can download this latest version from the main downloads page or windows.php.net for the Windows binaries.

tagged: language release bugfix php71

Link: http://php.net/index.php#id2017-01-19-1

Michelangelo van Dam:
Sessions in PHP 7.1 and Redis
Dec 19, 2016 @ 12:09:17

Michelangelo van Dam has a new post to his site looking at using Redis for PHP sessions storage and changes related to the use of PHP 7.1.

In case you have missed it, PHP 7.1.0 has been released recently. Now you can’t wait to upgrade your servers to the latest and greatest PHP version ever. But hold that thought a second…

With PHP 7 lots of things have changed underneath the hood. But these changed features can also put unexpected challenges on your path. [...] One of these challenges that we faced was getting PHP 7.1 to play nice storing sessions in our Redis storage. In order to store sessions in Redis, we needed to install the Redis PHP extension that not only provides PHP functions for Redis, but also installs the PHP session handler for Redis.

When he installed the extension, the latest version (redis-3.1.0), he was given an error message about a failure to read the session data. He shares a bit of code he used to try to debug and diagnose the problem (and a Docker environment) that still resulted in the error. Ultimately they narrowed it down and discovered that it was the Redis extensions causing the problems. Downgrading it from 3.1.0 to 3.0.0 solved the issue right away.

tagged: session redis php71 extension tutorial troubleshoot error connection

Link: http://www.dragonbe.com/2016/12/sessions-in-php-71-and-redis.html

Symfony Finland:
PHP 7.1 vs. 7.0 performance benchmarks with Symfony
Dec 12, 2016 @ 10:04:09

On the Symfony Finland site they've post together a post sharing some benchmark results of Symfony on PHP 7.0 versus 7.1, the most recent major release of the PHP language with some improvements of its own.

PHP 7.1 was launched on December 1st 2016. This was the first minor release after the release of 7.0 a year ago. PHP 7.0 was a revolutionary product, especially when it comes to memory usage and performance. PHP 7.1 is a more modest upgrade that brings new features and improved performance. But how much has performance improved from a year back?

The benchmarking uses the eZ Platform demo running a full CMS similar to the previous benchmarking done in 2015. The checks were run using:

  • a "clean" environment (no caching, PHP-FPM just restarted and no APC cache)
  • standard requests running in development mode
  • more requests but this time in production mode

The post shares the results with a few graphs showing them in terms of response time for both sequential and concurrent page requests.

tagged: php70 php71 benchmark symfony ezplatform cms results

Link: https://www.symfony.fi/entry/php-7-1-vs-7-0-benchmarks-symfony

SitePoint PHP Blog:
What’s New and Exciting in PHP 7.1?
Dec 09, 2016 @ 12:13:10

The SitePoint PHP blog has a new article posted sharing "what's new and exciting in PHP 7.1", the latest major version release in the PHP 7.x series. This version was released on December 1st of 2016.

The PHP community has gone viral with the latest PHP 7 announcement and all the goodies it brings to the language. The PHP 7.1 release has more good news and features to offer. This article highlights the most important ones, and you should check PHP RFC for the full list.

Included in their list of enhancements are features like:

  • the ArgumentCountError Exception
  • Nullable Types
  • the Iterable Type
  • Catching Multiple Exception Types
  • Invalid String Arithmetics

For each item on the list some brief code examples are provided, often showing the difference between the new behavior and previous PHP versions.

tagged: exciting new version php71 version release tutorial

Link: https://www.sitepoint.com/whats-new-and-exciting-in-php-7-1/

Colin O'Dell:
Installing PHP 7.1 December 2nd, 2016
Dec 08, 2016 @ 10:54:42

With the recent release of PHP 7.1 you might be asking how you can quickly and easily update your current installation, regardless of the platform. Thankfully Colin O'Dell is here to help with this guide to upgrading to v7.1 on multiple Linux distributions, OSX and Windows.

PHP 7.1 has been released, bringing some great new features and enhancements to the language such as nullable types, the iterable pseudo-type, catching multiple exceptions, and much more.

Here's a brief guide on how to install PHP 7.1 on several different operating systems.

He includes instructions for Ubuntu, Debian, CentOS/RHEL, Mac OS 10.6+ and Windows. Complete commands and links to the downloads are also provided. You have no excuse now not to upgrade - get downloading!

tagged: install php71 multiple platform tutorial linux osx windows

Link: https://www.colinodell.com/blog/2016-12/installing-php-7-1

Laravel News:
Laravel Homestead 4.0 is released featuring support for PHP 7.1
Dec 06, 2016 @ 09:43:35

The Laravel News site has a new post announcing the release of the latest version of Laravel Homestead, the Vagrant-driven environment that makes it easy to set up a Laravel environment. In this latest version, 4.0, there's a few changes including a major one: support for PHP 7.1.

Laravel Homestead the Vagrant box for easily running Laravel on any platform has just released v4.0 that includes support for the just released PHP 7.1.

The upgrade is easy but the instructions do vary depending on how you have it installed.

They walk you through the steps for the upgrade:

  • Backup all your Homestead databases
  • update the Homestead Global installation (or per-project installation)
  • Destroy the current Vagrant box
  • Use "vagrant up" to download the latest version and bring the box back up

It's a pretty easy process that should be pretty painless. Everyone's setup is slightly different so there might be a few issues in your own upgrade and minor version releases will be made if there are issues because of the upgrade.

tagged: laravel homestead vagrant upgrade v4 release php71 support

Link: https://laravel-news.com/laravel-homestead-4-0-is-released-featuring-support-for-php-7-1