PHP 7 at a Glance

April 9, 2015

PHP

PHP7 is on it’s way! This is the largest shift in the PHP landscape since the upgrade to PHP 5.3. Most of us survived that and I’m sure we will survive this one as well.

To help you see the forrest for the trees, I’ve put together a list of all the RFCs that are marked as “Implemented” on the PHP wiki. Some of them have not yet been updated to “Implemented” status and there are still others in the “Pending Implementation” section.

The sections, “Classification”, “BC Break”, and “Impact” are subjective.

 

Backwards Compatibility (BC) Break

A lot of the RFCs to not break BC at all. The rest of them are labeled “Possible”. This is because there are no RFCs in this list that are guaranteed to break your code. Most of them labeled “Possible” will affect edge-cases but not the main body of your code.

I asked one Framework Architect recently how they were instructing their users on converting their code to PHP 7 and their answer was this.

“Migrating to php 7: Change your composer require to 7, and composer update. Done.”

So unlike the jump to PHP 5.3, this should be easy for most.

How can you tell if you code will be affected? Download a PHP 7 “Nightly Build” compile and try your code on it.

 

Impact

Impact was harder to guess. This is not the impact of the change on your code, it is the impact of the change on PHP developers in general. I tried to look at each RFC objectively and decide how much it would impact their style of coding or the execution of their code. Most of the changes, as you can see, are low, however, several of the Engine changes have a high impact. The PHPNG, and Exceptions in the Engine are two examples, the first won’t change how you code but it will impact the execution of your code. The second will change how you build applications.

The entire chart is presented for you below to digest. However, here are a few subsets of the data.

 

High Impact PHP 7 RFCs

 

Possible BC Breaks in PHP 7

The Entire Chart

Title
Classification BC Break Impact Status Author
Move the phpng branch into master
Engine No High Accepted Dmitry Stogov
Zeev Suraski
Catchable “call to a member function of a non-object”
Language No High Accepted
Timm Friebe
Native TLS
Engine No Low Accepted
Anatol Belski
Combined Comparison (Spaceship) Operator
Language No Low Accepted
Davey Shafik
Andrea Faulds
Stas Malyshev
IntlChar class
Language No Low Accepted
Sara Golemon
Continue output buffering despite aborted connection
Engine Possible Low Accepted
Michael Wallner
Replacing current json extension with jsond
Engine Possible Low Accepted
Jakub Zelenka
Make defining multiple default cases in a switch a syntax error
Language Possible Low Accepted
Levi Morrison
Remove alternative PHP tags
Language Possible Low Accepted
Nikita Popov
64 bit platform improvements for string length and integer in zval
Engine No Medium Accepted
Anatol Belski
Matt Ficken
Stephen A. Zarkos
Closure::call
Language No Medium Accepted
Andrea Faulds
intdiv()
Language No Medium Accepted
Andrea Faulds
Null Coalesce Operator
Language No High Implemented
Andrea Faulds
Return Type Declarations
Language No High Implemented
Levi Morrison
Scalar Type Declarations
Language No High Implemented
Anthony Ferrara
Abstract syntax tree
Engine Possible High Implemented
Nikita Popov
Exceptions in the engine (for PHP 7)
Language Possible High Implemented
Nikita Popov
Remove the date.timezone warning
Language No Low Implemented
Bob Weinand
Reclassify E_STRICT notices
Engine Possible Low Implemented
Nikita Popov
Reserve More Types in PHP 7
Engine Possible Low Implemented
Levi Morrison
Uniform Variable Syntax
Engine Possible Low Implemented
Nikita Popov
ZPP Failure on Overflow
Engine Possible Low Implemented
Andrea Faulds
Constructor behaviour of internal classes
Language Possible Low Implemented
Dan Ackroyd
Fix “foreach” behavior
Language Possible Low Implemented
Dmitry Stogov
Fast Parameter Parsing API
Engine No Medium Implemented
Dmitry Stogov
Bob Weinand
Expectations
Language No Medium Implemented
Joe
Dmitry
Filtered unserialize()
Language No Medium Implemented
Stas Malyshev
Generator Return Expressions
Language No Medium Implemented
Daniel Lowrey
Group Use Declarations
Language No Medium Implemented
Márcio Almada
Unicode Codepoint Escape Syntax
Language No Medium Implemented
Andrea Faulds
Integer Semantics
Engine Possible Medium Implemented
Andrea Faulds
Removal of dead or not yet PHP7 ported SAPIs and extensions
Engine Possible Medium Implemented
Anatol Belski
Fix list() behavior inconsistency
Language Possible Medium Implemented
Dmitry Stogov
Remove hex support in numeric strings
Language Possible Medium Implemented
Nikita Popov
Remove PHP 4 Constructors
Language Possible Medium Implemented
Levi Morrison
Introduce session_start() options – read_only,
unsafe_lock, lazy_write and lazy_destroy
Language No Low Passed
Yasuo Ohgaki
Fix handling of custom session handler return values
Language Possible Low Voting
Sara Golemon

 

Further Reading

Want more information? Davey Shafik of Engine Yard has started a great article series, “What to expect when you are expecting: PHP 7″. The articles are short and concise and well worth a read.

 

, , ,

About Cal Evans

Many moons ago, at the tender age of 14, Cal touched his first computer. (We're using the term "computer" loosely here, it was a TRS-80 Model 1) Since then his life has never been the same. He graduated from TRS-80s to Commodores and eventually to IBM PC's. For the past 10 years Cal has worked with PHP and MySQL on Linux OSX, and when necessary, Windows. He has built on a variety of projects ranging in size from simple web pages to multi-million dollar web applications. When not banging his head on his monitor, attempting a blood sacrifice to get a particular piece of code working, he enjoys building and managing development teams using his widely imitated but never patented management style of "management by wandering around". Cal is happily married to wife 1.31, the lovely and talented Kathy. Together they have 2 kids who were both bright enough not to pursue a career in IT. Cal blogs at http://blog.calevans.com and is the founder and host of Nomad PHP

View all posts by Cal Evans

No comments yet.

Leave a Reply

You must be logged in to post a comment.