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

Lorna Mitchell:
PHP 7.0 (and 5.6) on Ubuntu
Feb 11, 2016 @ 10:52:59

In this new post to her site Lorna Mitchell show you how to get both PHP 7 and PHP 5.6 installed on a Ubuntu-based system with the help of a custom PPA (Personal Package Archive).

PHP 7 is released but for those of us who don't usually compile our own PHP, it can be a long wait for our preferred distro to release the packages we want. For Ubuntu, I'm using a PPA which allows both PHP 5.6 and PHP 7.0 to be installed, including things like extensions, at the same time. It was very easy to set up (I'm running Ubuntu 15.10 but this process should also work on older versions back to at least 14.04 which is the previous LTS) so here's a quick walkthrough of what I did.

She then shows you how to:

  • Add the PPA to your system (this one)
  • Install the new versions as expected with apt-get
  • Configuring and switching between versions as needed

She ends the post talking about extensions and the issues that could come up when compiling them against each of the versions. This includes installation instructions so you can easily enable and disable the extensions much like the "sites available" some Apache installations use.

tagged: php7 php56 ubuntu ppa package install custom extension tutorial

Link: http://www.lornajane.net/posts/2016/php-7-0-and-5-6-on-ubuntu

Rudi Theunissen:
Efficient data structures for PHP 7
Feb 09, 2016 @ 10:49:37

In this recent article over on Medium.com Rudi Theunissen looks at more efficient data structures for PHP 7 and the introduction of a library that wants to help replace some of the current functionality and dependencies on things like arrays.

PHP has one data structure to rule them all. The array is a complex, flexible, master-of-none, hybrid data structure, combining the behaviour of a list and a linked map. But we use it for everything, because PHP is pragmatic.

[...] The recent release of PHP 7 caused a lot of excitement in the PHP community. We couldn't wait to start using the new features and get a taste of the ~2x performance boost. One of the reasons why it runs that much faster is because the array was redesigned. But it’s still the same structure, “optimised for everything; optimised for nothing” with room for improvement.

He starts with a brief mention of some of the current topics around data structures - the SPL functionality, why fixing them would be difficult and, finally, introducing the library that seeks to supersede them. The remainder of the post goes through the pieces of functionality the library offers and explains how each works including videos and graphs of the performance results:

  • Collection
  • Sequence
  • Vector
  • Deque
  • Stack
  • Queue and PriorityQueue
  • Hashable
  • Map
  • Set

He also answers some of the most common questions he's gotten about the library including the level of testing, documentation for the project and why he structured certain elements and features how he did.

tagged: data structure php7 library ds spl optimized video code

Link: https://medium.com/@rtheunissen/efficient-data-structures-for-php-7-9dda7af674cd#.xg74fpxwg

Rasmus Lerdorf:
Upgrading PHP on the EdgeRouter Lite
Jan 26, 2016 @ 10:30:33

Rasmus Lerdorf has shared a post to his site detailing how he upgraded his EdgeRouter Lite router (hardware) to use PHP 7 for the uI handling and processing, upgrading it from the PHP 5.4 it came installed with.

After nearly 7 years of service I retired my Asus RT-16 router, which wasn't really a router, but a re-purposed wifi access point running AdvancedTomato. In its place I got a Ubiquiti EdgeRouter Lite. It is Debian-based and has a dual-core 500MHz 64-Bit MIPS CPU (Cavium Octeon+), 512M of ram and a 4G removable onboard USB stick for < $100. The router is completely open and, in fact, any advanced configuration has to be done from the command line. The Web UI has been improving, but there are still many things you can't do in it. In other words, exactly the type of device I prefer.

He made use of the open platform the router has to upgrade both the PHP installation and a bit of the web UI code to make things work happily with PHP 7. There's just three steps in his process:

  • Getting a Big-Endian MIPS64 build of PHP 7
  • Configuration (php.ini)
  • Fixing broken stuff

The "broken stuff" in this last item was only a few small changes that needed to be made to the web UI code for raw POST data fetching and session writes. He ends the post with a little summary of the performance post-changes and some about the opcode handling and memory use per request.

tagged: router edgerouter ui version language install upgrade configuration bigendian mips64 php7

Link: https://toys.lerdorf.com/archives/59-Upgrading-PHP-on-the-EdgeRouter-Lite.html

Softpedia.com:
Debian Is Moving to PHP 7, and So Are Numerous Other Linux Distributions
Jan 18, 2016 @ 10:48:36

According to this new article on the Softpedia site, Debian and several other major Linux distributions will soon be making the move up to PHP 7 for their releases, the latest major version of the PHP language.

The Debian developers have publicly announced their plans to migrate all of the PHP 5 to the brand new and powerful PHP 7 release, as well as to change the PHP packaging to allow co-installable versions.

The announcement was made by Debian developer Ond?ej Surý a few couple of days ago on one of Debian Project's mailing lists, where he informs Debian devs about the changes made to the PHP packaging for the operating system, in the pkg-php packaging group.

In fact, PHP 7 has already made it to the unstable releases of the Debian linux distribution for those that would like to test things out. You can find out more of the specifics in this mailing list post on their implementation plans.

tagged: debian php7 migration mailinglist linux unstable

Link: http://news.softpedia.com/news/debian-is-moving-to-php-7-and-so-are-numerous-other-linux-distributions-498951.shtml

Evert Pot:
Strict typing in PHP 7 - poll results
Jan 15, 2016 @ 11:19:54

Evert Pot has shared the results of a poll he recently set up on Twitter asking PHP developers if they planned to make use of the strict typing functionality in PHP 7 in their applications. Unsurprisingly, the majority voted that they will with a more undecided audience coming in second.

Type hinting comes in two flavors: strict and non-strict. This is the result of a long battle between two camps, a strict and non-strict camp, which in the end was resolved by this compromise.

Now by default PHP acts in non-strict mode, and if you'd like to opt-in to strict-mode, you'll need to start every PHP file with this statement. [...] So I was curious about everyone and whether you will be using strict mode or not. Results are in.

According to those that voted 46% were completely in favor of using the declare statement to enable strict typing in their PHP 7 code by default. The next group, the "undecided" were at 26% with "no way" and "what is that?" coming in farther down the list. He also mentions a package that's in the works from Justin Martin that would automatically add the declare statement to your code in the desired location(s). Additionally there's an extension in development from Joe Watkins that will do the same thing but making it a bit more automatic.

tagged: php7 strict type declare poll results usage composer package extension

Link: https://evertpot.com/strict-types-pollresults/

SitePoint PHP Blog:
Setting up PHP 7 Servers with Laravel Forge and DigitalOcean
Jan 07, 2016 @ 11:11:38

The SitePoint PHP blog has another new article from editor Bruno Skvorc showing you how to set up PHP 7 servers in two different ways: one the DigitalOcean platform and the other using the Laravel Forge service.

In this quick guide, we’ll cover two ways to bring a PHP 7 server online on DigitalOcean – a popular VPS provider. We’ll use two approaches, the latter of which will be applicable to any Ubuntu installation whereas the former will only work on DigitalOcean.

He starts with a brief description of what Laravel Forge is for those not familiar with it and how to use it to set up your new server instance. Screenshots of the interface are included showing the setup of the instance, backups, configuration of the server and how to link it to a repository. Then he gets into the more "manual" installation, working with a simple low-tier DigitalOcean droplet to secure and configure it with similar kinds of features: PHP 7 installed and working, Nginx and a fresh checkout of the repository.

tagged: php7 server tutorial setup laravelforge digitalocean deploy repository

Link: http://www.sitepoint.com/setting-up-php-7-servers-with-laravel-forge-and-digitalocean/

PHP.net:
PHP 7.0.2 Released
Jan 07, 2016 @ 09:30:21

The PHP project has officially released the latest in the PHP 7.0.x series of releases: PHP 7.0.2:

The PHP development team announces the immediate availability of PHP 7.0.2. 31 reported bugs has been fixed, including 6 security related issues. All PHP 7.0 users are encouraged to upgrade to this version.

There's quite a few bugs fixed in this release including updates in:

  • CURL
  • Filter
  • FTP
  • GD
  • Opcache
  • Session
  • SPL

As always you can download this release from the main download page or the Windows binaries from the windows.php.net site.

tagged: language release php7 minor bugfix download

Link: http://php.net/archive/2015.php#id2016-01-07-1

Symfony Finland:
Symfony Benchmarks: PHP 5.6, HHVM 3.11 and PHP 7.0.1
Dec 29, 2015 @ 10:53:46

The Symfony Finland has shared some benchmarks of the latest versions of the Symfony framework (simple applications) on three current environments to see the differences: PHP 5.6, HHVM 3.11 and PHP 7.0.1.

Since the first functional versions of PHP 7.0.0 were made available, there have been a number of benchmarks comparing PHP 5.6, HHVM and PHP 7. [...] The recently released eZ Platform is a CMS built on the Symfony framework. It's a good representation of a modern PHP application with complex functionalities and no legacy code from the 2000's. Thus making a good candidate benchmarks for testing an application built with the Symfony Framework (version 2.7.8).

So let's see how an application built with the Symfony2 framework fares on PHP 5.6, HHVM 3.11 and PHP 7.0.1.

He starts by describing the test setup including the default installation of the eZ platform and how it was configured/set up. He then shares the results, showing memory usage and response times for each of the three different platforms. There's even results from different parts of the application: the front page and the "Top Stories" and "Projects" pages. The results also include the findings for the number of requests per second both with and without the Symfony Proxy included in the platform.

tagged: symfony benchmarks php56 hhvm php7 requestspersecond memory consumption graph

Link: https://www.symfony.fi/entry/symfony-benchmarks-php-56-hhvm-and-php-7

Jordi Boggiano:
The Road to Monolog 2.0
Dec 23, 2015 @ 11:18:01

Fans of the Monolog logging library (used by loads of major PHP-based projects too) will be interested in checking out this post about version 2 from Jordi Boggiano, lead developer on the project.

Monolog's first commit was on February 17th, 2011. That is almost 5 years ago! I have now been thinking for quite a while that it would be nice to start on a v2, and being able to drop some baggage.

One of the main questions when doing a major release is which minimum PHP version to support going forward. Last summer I decided I wanted to do a big jump from 5.3 and directly target PHP 7. It provides a lot of nice features as well as performance improvements, and as Monolog is one of the most installed packages on Packagist I wanted to help nudge everyone towards PHP 7.

Now that PHP 7 has been released, he's moving even more towards this goal for version 2 of the popular tool. He talks about "the road forward" and links to a milestone that's been set up with issues to correct and features to update before v2.0 can be called stable. He does offer a word of warning too - if you use dev-master for your Composer installs, update it to use ^1.17 instead as the main branch will break soon with the work for v2.

tagged: monolog v2 php7 major release upcoming milestone

Link: http://seld.be/notes/the-road-to-monolog-2-0

PHP.net:
PHP 7.0.1 Released
Dec 17, 2015 @ 09:21:50

The latest release in the PHP 7.0.x series has been released today, the first one following the major milestone of PHP 7: PHP 7.0.1.

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

This is just a bugfix release with some smaller changes that were held off until after the main PHP 7.0 release came out. Bugs were fixed in the language core, the CLI server, OCI8 functionality and many others. PHP 7 users are encouraged to upgrade to this new release. You can download it as always from either the main php.net downloads page or windows.php.net for the Windows binaries.

tagged: php7 release language bugfix php701 upgrade download

Link: http://php.net/index.php#id2015-12-17-1