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

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

Laravel News:
Deprecations for PHP 7.2
Jan 31, 2017 @ 11:15:06

In this new post to the Laravel News site they list out some of the deprecations coming in PHP 7.2 based on this RFC.

The PHP 7.2 RFC for deprecating some current functionality has been approved. The following items are included in this list and will begin throwing deprecated notices.

The list of features to be deprecated includes:

  • the magic __autoload function
  • the create_function function
  • the (unset) cast
  • the each function

Most of the things in the list are functionality that you just don't see much in recent PHP development. It could cause problems for older codebases but for those already on PHp 7 it shouldn't take much to make the necessary changes.

tagged: php72 deprecation notice version rfc multiple

Link: https://laravel-news.com/php-7-2-deprecations

Michael Dyrynda:
Switching PHP versions with Laravel Valet
Jan 24, 2017 @ 09:57:40

On his site Michael Dyrynda shows you how to switch PHP versions in Laravel Valet away from the current default of PHP 7.1 (should the need arise).

At the time of writing, Laravel Valet ships with PHP 7.1 but if you're like me, you have some legacy projects around the place that haven't quite lifted their dependencies to PHP 7 just yet.

A lot of folks might have previously used a VirtualBox Virtual Machine, or more recently considered Docker but a lot of the time and especially when dealing with simpler situations, Valet may be all that you need.

Luckily, the combination of Valet and brew on macOS makes switching PHP versions really easy.

With the help of the Homebrew tool it's as easy as telling it to install the PHP version you require and create the link to this needed version. He's included two screencasts in the post to show the process and commands you'll need to accomplish it.

tagged: laravel valet language version switch homebrew link tutorial

Link: https://dyrynda.com.au/blog/switching-php-versions-with-laravel-valet

Laravel News:
How to Use Old Versions of Laravel Homestead
Jan 20, 2017 @ 09:39:32

On the Laravel News site they've posted a tutorial by Joe Ferguson showing you how to [use older versions of Homestead](https://laravel-news.com/using-older-versions-of-homestead, the box not the app, in your development environment if there's a need.

There are two parts to Homestead: the Vagrant box and the Homestead source code (Homestead app). The Homestead Vagrant box is a snapshot of a preconfigured virtual machine ready to use. [...] We use the Laravel Settler repo to build the Homestead boxes. You have to ensure the version of the Homestead Vagrant box is compatible with the version of the Homestead app you are using.

Why would you want to use a previous version? [...] While Homestead development moves forward pretty quickly, you may not be ready to move your clients from PHP 5.5. While you should have already moved your apps to PHP 7.0 for the performance gains, I understand that because Laravel 5.1 supports 5.5, developers may want to continue using that version.

He then walks you through an example, showing how to use PHP 5.5 with Homestead and what version to put for the best support. It requires a little bit of manual fiddling around but not too much. Then it's just a simple "vagrant up" to get it running. He also includes instructions on using PHP 7.0, checking out a different version of the Homestead repository and bringing up the box similar to above.

tagged: laravel homestead version older vm application framework support

Link: https://laravel-news.com/using-older-versions-of-homestead

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/