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

Master Zend Framework:
How to Migrate from Zend Expressive Version 1 to 2 with Command-Line Tooling
Jun 27, 2017 @ 10:43:30

On the Master Zend Framework site Matthew Setter has written up a new tutorial showing you how to migrate from Zend Expressive v1 to v2 with the help of some command line tooling support provided as a part of recent updates to the project.

In part one of this series, we started learning about the tooling support available for Zend Expressive, provided by Zend Expressive Tooling There, we learned how we can use the package to create, register, and deregister middleware, and scaffold new modules. But that's only half of what the package can do.

Here, in part two, let's learn about the other half, which removes some of the heavy lifting required when migrating Zend Expressive applications from version one to two.

He first defines some of the main differences between the two versions, a checklist of things the tooling will help you more automagically update. He talks more specifically about migration support, moving to "programatic pipelines" in Expressive v2 and scanning for deprecated error middleware. There's also information about locating the legacy request and response handling and how they're refactored to the newer format.

tagged: tutorial zendexpressive zendframework migrate version update tooling commandline

Link: http://www.masterzendframework.com/tooling/migrating-to-version-2/

Zend Framework Blog:
Zend Framework and PHP 7.1
Jun 07, 2017 @ 12:18:45

On the Zend Framework blog Matthew Weier O'Phinney has a new post covering the state of the Zend Framework project and how it relates to PHP 7.1.

When we announced Zend Framework 3 last year, one of the changes was setting the minimum supported PHP version to 5.6. Our initial plan was to support 5.6 until it reaches end-of-life, which occurs 31 December 2018.

PHP 5.6, however, stopped receiving active support almost five months ago, on 19 Jan 2017. This means that it is no longer receiving bugfixes, only critical security fixes. As such, a number of contributors have been pushing for us to up our minimum supported version to support only actively supported PHP versions, which would mean only PHP 7 versions.

[...] Our view is that the new features in PHP 7 will allow us to simplify our code dramatically, reduce bugs (primarily by increasing type safety), make our code more easily maintainable (less code required to check types; less repetitive code), provide stronger and more predictable interfaces to our users, and simultaneously provide users access to more and better language features.

He also talks briefly about their thoughts about HHVM support and if it makes sense to keep moving forward with it (given the small percentage of their user base). He then lays out a plan for the framework moving forward that includes the release of PHP 7.1+ only components and security patches on 5.6 versions until end of life.

tagged: zendframework php71 version future roadmap php56 hhvm project

Link: https://framework.zend.com/blog/2017-06-06-zf-php-7-1.html

Jordi Boggiano:
PHP Versions Stats - 2017.1 Edition
May 09, 2017 @ 09:16:21

Jordi Boggiano, author and lead developer on the Composer project has posted his latest updates sharing the PHP version statistics for the first part of 2017.

It's stats o'clock! See 2014, 2015, 2016.1 and 2016.2 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 starts with the differences between now and the last time he ran the stats with a nice trends towards the PHP 7.x releases, especially PHP 7.1. He shares some graphs of the overall version distribution and a time-related graph showing changes in usage over time. Finally, he ends the post the same way as the others showing requirements of packages and how they've changed since the last update (what version a package requires).

tagged: version statistics results graph time php7 2017

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

SitePoint PHP Blog:
Upgrading from PThreads v2 to V3: What to Look out For
Mar 30, 2017 @ 12:43:15

On the SitePoint PHP blog Thomas Punt has returned with more pthreads knowledge and shows you a few things to watch out for when upgrading from pthreads v2 to v3. pthreads is a PHP extension that allows for better process handling directly from PHP than just the built in proc_* functions.

A fair amount has changed for the pthreads extension with the release of pthreads v3. This article aims to cover the necessary information for those who are looking to upgrade their applications from pthreads v2 to v3.

If you’re unfamiliar with pthreads, check out my introduction to pthreads instead!

He starts with some of the more generic changes in this latest version with the most major being that it can now only be used in the command-line environment. Other changes were made to workers, method modifiers and the removal of some classes and methods. He also mentions some of the methods that were changed and some new classes/methods that were added. Overall he's of the opinion that, while some of the changes could make for headaches in the transition, v3 of the extension has "received a nice cleanup and is looking ever better."

tagged: pthreads threading version change upgrade guide

Link: https://www.sitepoint.com/upgrading-pthreads-v2-v3-look/

Zend Framework Blog:
Announcing Expressive 2.0
Mar 07, 2017 @ 11:43:29

On the Zend Framework blog today Matthew Weier O'Phinney has posted the official announcement of the release of Zend Expressive v2.0, the latest major release with several large changes.

Today we're excited to announce Expressive 2.0! What has changed since 1.0 was released last year? The short version: we've been providing changes that standardize, simplify, and streamline application development in Expressive.

Updates in this latest version include:

  • PSR-11 (ContainerInterface) support
  • Programmatic pipelines
  • An emphasis on modularized applications
  • Extensible routing and dispatch middleware

The post gets into details on each of the above topics and several others. It also shows how to install this latest version via Composer (or install the skeleton application to get up and running quickly).

tagged: zendframework zendexpressive v2 release announcement major version

Link: https://framework.zend.com/blog/2017-03-07-expressive-2.html

Rasmus Lerdorf:
A bit of PHP history
Feb 22, 2017 @ 12:55:24

If you were ever interested in the early days of PHP (back in the PHP/FI days, pre-3.0 even) Rasmus Lerdorf has a post sharing an old Changelog he created for some of the first PHP version releases.

Ran across this Changelog from a long long time ago. Read from the bottom up. I added the PHP Tools lines at the bottom for context. So many early decisions made on a whim still affecting us today. And then there are things like "Removed **, // and %% operators" which did a vector dot-product and its inverse, I think. I seem to recall deleting it when I tried to document it.

No years on most of the entries, but version 1.90 was on Sept.18, 1995.

It's an interesting read to see some of the thoughts and additions to the language early on. You can see which functions were added way back then and which ones have been dropped since including an entry for October 17th - "First public release of the code".

tagged: language history changelog early version

Link: https://toys.lerdorf.com/archives/61-A-bit-of-PHP-history.html#extended

Laravel News:
Laravel 5.5 Will Be The Next LTS Release
Feb 21, 2017 @ 11:26:28

According to this quick post on the Laravel News site the next version of the framework that will get long term support (LTS) will be version 5.5:

Version 5.1 was Laravel’s first LTS release and its two-year window of bug fixes are coming to an end this year. There have been a few people questioning if another LTS would be released and version 5.5 would be the next in line if it did happen.

Just today Laravel announced on Twitter that Laravel 5.5 will, in fact, continue the LTS line. [...] Just as the previous LTS this will include two years of bug fixes and three years of security updates.

Long term support means that the version will be "feature locked" on release but will continue to get bugfixes for issues found until the end of the maintenance window is reached.

tagged: laravel lts longtermsupport version announcement laravel55

Link: https://laravel-news.com/laravel-5-5-lts

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

Matt Stauffer:
Defining console commands via closure in Laravel 5.3
Feb 17, 2017 @ 11:06:37

Matt Stauffer has posted the latest article in his "New Features in Laravel 5.3" series today. In this new tutorial Matt focuses on the creation of console commands - additional functionality you can add in to the pre-existing "artisan" command handling.

Before Laravel 5.3, defining an Artisan console command—something like php artisan sync:dates—required you to create a new class for that command and register it in the Console Kernel. This is fine, but sometimes it feels like overkill for what might end up just being a single line of functional code.

As of Laravel 5.3, you'll notice that there's a new method in the Console/Kernel.php file named commands(), and it loads a new file at routes/console.php. This new "console routes" file allows us to define Artisan console commands with a single Closure instead the prior "define a class then register it in the console Kernel" flow. Much faster, much easier.

In v5.3 you define commands using "routes" along with a simple description using fluent statements. He shows how to add a simple command, one with input and a more streamlined example pulling values directly from the "route" signature.

tagged: laravel console commands closure v53 version tutorial route closure

Link: https://mattstauffer.co/blog/defining-console-commands-via-closure-in-laravel-5-3

ThePHP.cc:
The Death Star Version Constraint
Feb 16, 2017 @ 09:58:30

In a new post to thePHP.cc blog Sebastian Bergmann talks about Death Star Version constraint and how it could cause issues in your application if your version definitions are too loose.

PHPUnit 6, a new major version of the de-facto standard for testing PHP-based software, was recently released. Soon after, the test suites of developers who did not yet want to upgrade to the new version stopped working. What had happened?

In a nutshell, these PHP developers were caught off guard by the consequences of using the "Death Star" version constraint in their composer.json file, the * operator.

He gives an example where a user may have specified "*" in their composer.json file, leaving it wide open to get whatever the latest version is. He then talks some about semantic versioning and how it should be used in Composer configurations to ensure you're always working with the versions you're expecting. Locking down versions is good, but he also makes a recommendation to "keep dependencies fresh", providing bug fixes, new features and functionality as well as security updates.

tagged: version constraint semantic deathstar fresh

Link: https://thephp.cc/news/2017/02/death-star-version-constraint