Learn PHP 7, Find out What’s New, and More

Bruno Skvorc

PHP 7, the next version of the world’s most popular programming language, has been released. We’d love to shoot fireworks and get drunk with our newfound power (seriously, the language is in the true big leagues now, functionality and performance-wise) but we’re sure the rest of the internet will do this for us. Instead, we’ll focus on compiling a (perpetually up to date) list of resources to get started with version 7 – posts describing what’s new, books helping you kick things off, and more. Let’s get to it!

What Happened to PHP 6?

When told the next major version is 7 while we’ve been developing on 5+ so far, many wonder what happened to version 6. It’s a long story, so to avoid looking confused when this is brought up, here are some interesting discussions and posts as required reading:

In short, the unicode problems that were supposed to be solved in version 6 ultimately failed, with too many added complications, and this kind of ruined things for everyone. It was decided that version 6’s rep was too damaged to keep it alive, and a move to PHP 7 was made.

New Features

We’ve spoken about the new features briefly before, but here’s a more comprehensive list of links to information about them – now’s the time to dive in and get ready.

To learn about what’s coming and what an impact it might have on you:

If you’re into video lessons and don’t mind paying for them, two sites covered basically the same thing:

To learn about the type system, arguably the biggest change, and how it compares to hack:

Getting Started with PHP 7

Various compatibility checkers and converters are available:

  • PHP7MAR (Migration Assistant Report) will report any inconsistencies between your current code base and PHP 7, so you can plan and budget your upgrade path
  • php7ize is a code fixer that tries to add PHP 7 features into a PHP 5 codebase automatically
  • php7cc (Compatibility Checker) will try and do the same things as the MAR above – compare their outputs for the most reliable results.

It should be noted that none of the tools above are a replacement for a good test suite – the only way to be 100% certain there’s no bugs left behind is to cover your code with tests so it can be easily inspected and verified during migration.

Last but not least, PHPToday have put together an absolutely fantastic list of talks which you can take a look at here.

Tools, testing and hosting

Lots of helpful tools have already sprung up around the new release:

  • PhpStorm, ahead of the pack as ever, already comes with full PHP 7 mode.

  • Phan is a static analyzer, the features of which you’d best read about here. We’ve got a full tutorial coming up, for the curious.

  • Exakat is another analyzer

  • Tuli is yet another – but development is somewhat halted. If anyone wants to write a comparison post targeting all three, let us know!

  • Andrea Faulds threw out some interesting PHP 7 exclusive packages that warrant a look!

  • A Vagrant box by Rasmus Lerdorf is the box to use when testing on multiple versions of PHP, and can be downloaded here. Tutorial about using it here.

  • Travis CI has supported PHP 7 for a while now. Setting a project up to be 7-tested is easy, just make your .travis.yml file look something like this:

    language: php
      - 5.6
      - 7.0
      - hhvm
    # This triggers builds to run on the new TravisCI infrastructure.
    # See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/
    sudo: false
        - php: 7.0
      - travis_retry composer self-update
      - travis_retry composer install --no-interaction --prefer-source
      - phpunit --coverage-text --coverage-clover=coverage.clover
      - if [[ $TRAVIS_PHP_VERSION != 'hhvm' && $TRAVIS_PHP_VERSION != '7.0' ]]; then php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover; fi

    The above was inspired by the PhpLeague skeleton – a PHP 7 ready skeleton package, so if you’re starting a new one, that’s where to look for a baseline.

  • Right now, the hosting space is rather sparse for PHP 7, but keep an eye on http://phpversions.info/php-7/ – the list will be updated as new information rolls in.


For resources on developing extensions for PHP 7 (things are bit different with the extension API), http://gophp7.org/gophp7-ext/ is still the go-to site.

To join communities and discuss things or seek help, some of the following may be of help, in order of popularity:

  • On IRC, the ##php group on freenode will be of use
  • For those in favor of a more static medium, the PHP subreddit can be a place of knowledge, but also a minefield. Tread carefully.
  • If you’re not of the IRC or Reddit kind, but like live discussion nonetheless, there’s the PHP Slack Channel and the StackOverflow PHP chat room
  • To join a user group for some offline hanging out, check out http://php.ug/


Got more resources to share? Let us know! Paid or not, we’ll look at everything you throw at us and potentially include it.

With PHP 7 out, do you intend to convert your apps/packages any time soon? If not, why? Let us know your thoughts and feelings below! And don’t forget – the new version wouldn’t have been possible without the hard work of all the core contributors. They may not always all see eye to eye, but when they pool their resources and run towards a common goal, the sky’s the limit. Here’s to you, champs, thanks for keeping the web epic!