-
PHP 7.0 (and 5.6) on Ubuntu
11 February 2016
Read morePHP 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.
-
Generating a File List for Phan
27 November 2015
Read morePhan is the PHP Analyzer for PHP 7 code. I've been using it, partly out of curiosity, and partly to look at what the implications of upgrading my various projects will be. The simplest usage instructions are:
phan -f filelist.txt
I generated my filelist.txt files with …
-
PHP: Calling Methods on Non-Objects
19 October 2015
Read morePHP has subtly changed the wording of this error between various versions of the language, which can trip up your log aggregators when you upgrade so I thought I'd give a quick rundown of the changes around the "call to member function on non-object" error in PHP, up to and including PHP 7 which has an entirely new error handling approach.
-
New in PHP 7: null coalesce operator
30 September 2015
Read moreNot the catchiest name for an operator, but PHP 7 brings in the rather handy null coalesce so I thought I'd share an example.
In PHP 5, we already have a ternary operator, which tests a value, and then returns the second element if that returns true and the third if it doesn't:
-
SOAPFault When Switching PHP Versions
04 August 2015
Read moreI'm working on an update to my PHP Web Services book and with PHP 7 likely to release before the book even makes it into print, I'm testing all my example code across PHP 5.6 and PHP 7 ... which today gave me a weird problem with a very, very simple SOAP example.
-
PHP 7 Benchmarks
06 July 2015
Read moreIf you know anything at all about PHP7, you probably know it's fast. But did you know how fast? The alpha is out and looks very robust, so I decided I would create a new set of benchmarks to include it. Graphs first, disclaimers later :)
This graph shows the time it takes for each version of PHP to perform the same task, on average, with oldest PHP on the left and moving forward in time.
-
PHP7: Easiest Upgrade Yet
19 May 2015
Read moreWith PHP7 looking increasingly stable (relatively speaking, it's still pre-alpha so it's VERY early days and anything could happen!), and work going well on the GoPHP7-ext project to get extensions converted, I have been thinking about the migration guides we'll need to help people upgrade their existing applications. To this end, I took the simplest project I currently have (http://api.joind.in) and gave it a whirl on PHP7, using Rasmus' PHP7 dev box. The result:
Total lines of code change needed to make the @joindin API work on PHP7: zero
— Lorna Mitchell (@lornajane) May 14, 2015
