By Bruno Skvorc

PHP 5.6.0. Released

By Bruno Skvorc

PHP 5.6.0., considered a very important cornerstone by many, has been released today. We’ve talked about the changes this version brings in previous posts, and others have written about it, too.


To recap quickly:

  1. MIME types in the CLI web server have been added
  2. Internal Operator Overloading
  3. Uploads of over 2GB are now accepted
  4. POST data memory usage decreased and ::/input is reusable
  5. Improved syntax for variadic functions, functions that can accept an arbitrary number of arguments
  6. Argument unpacking
  7. Constant Scalar Expressions
  8. PHPDBG bundled by default
  9. Zip improved
  10. Importing namespaced functions and constants
  11. Exponentiation ($a = 2**3;)
  12. Default UTF-8
  13. GMP operator overloading

Regarding BC breaks, some of them include:

  1. GMP resources are now objects, which will break previous usages of is_resource
  2. mcrypt requires valid keys and IVs
  3. json_decode is more strict about upper/lower case on “true”, “false” and “null”

You can go into detail by reading the previous posts we wrote on these topics, or by reading the migration guide:



You might be wondering about update procedures – do you have to add new repos to your OS or compile from source to get them to work? What about VMs? Well, you can do that (see our old post on getting RC1 to run on Homestead, or coderabbi’s post about upgrading the current Homestead box to 5.6), but you don’t have to. Taylor Otwell has already promised to update the original Homestead box with 5.6, so you can continue to use our Homestead Improved as you always did – up and running in five minutes tops.

Like the man says, all you’ll need to do is run vagrant box update and your box will be refreshed with the latest version. This applies both to the original Homestead and my own Homestead Improved. It might take a while for Vagrant to redownload the box, but once done, everything should be as easy as it ever was.

Note: The box has since been updated, enjoy!

If you’d like to keep track of the original box to see when it updates, see here.

What now?

So what’s next? While the internals group is working on PHPNG and PHP7, whatever those may end up being called, take the time to get familiar with PHP 5.6. If you use shared hosting, ask them to upgrade. If they don’t have plans to do so, ditch them and show them you don’t support outdatedness. Get a cheap virtual server at DigitalOcean – heck, using this link will even get you $10 which lets you host a level two server for a whole month, or a level one server for two months. That’s plenty of time to see what they offer.

Use Heroku’s free tier to get 5.6 up and running, play around with it, explore. Step ahead of the curve by diving head first into the cutting edge and don’t let yourself be left behind by those ready to take the plunge. We’re stable, this is no longer beta or RC mode – it’s safe to upgrade, and it’ll only benefit your applications in the long run. If you’ve got some legacy code to maintain, ditch that too if it’s not compatible with 5.6.

Have you experimented with 5.6 features in a real world use case yet? Let us know in the comments below! Better yet – if you can put together advanced demos of these features, we’ll pay you for the right to publish them. Go forth, and multiply your projects!

  • CTN

    this latest version is for dev only, not for production, so I don’t think anyone would be ditching hosts.

    In any case, if you’re serious about developing, you would have a VPS or dedicated server and you can load whatever you like on the box. shared hosting is for end users.

    • “this latest version is for dev only, not for production”

      Um, no.

      PHP 5.6.0 is a stable release, completely suitable for production use. Notice how there isn’t any “RC5” on the end, therefore it’s considered a stable release, and indeed I’ve not encountered any bugs.

      • CTN

        LOL. seriously? it got released today and you think it’s ready for production servers?

        no serious project will run on a new release anything until it’s been thoroughly tested.

        and no, your wordpress blog is not a serious project.

        • It *has* been tested, that’s what the month of RC mode and all those betas were for.

          • CTN

            I knew someone was going to say this. I was just waiting for it.

            All the release candidates in the world and betas still don’t equate to the final released version.

            5.6 will still only be used for dev servers and testing purposes for weeks and months until management is satisfied that it is willing to bet their mission critical apps on it.

          • Again, no.

            Only the paranoid would not upgrade to 5.6.0, as it has been thoroughly tested. Software is never “done” as the old saying goes, there will always be bugs reported and fixed, but the point is nothing that would stop a serious project is going to come up, that’s what the RC releases were for, fixing major issues.

            By the way, I’ve never used WordPress, or any CMS.

    • WC

      The latest stable is PHP 5.6 now. But I absolutely agree that nobody should ditch hosts simply for not upgrading on the day of release. That’s ridiculous.

      • Not on the day, but there’s really no excuse to be running 5.3 in an age where it’s in EOL stage. Hostgator offered multiple runtimes at the same time back when I was using them, that’s a good approach, though I don’t know if using shared hosting at all any more can even be called acceptable, in an age of $5 VPS.

        • CTN

          there is one issue with $5 VPSes, which is that they’re self managed, which means developers need to also be Linux system admins.

          and if you install cpanel on them, that instantly adds $20 per month.

    • Wrong – it’s now a production release.

  • dojoVader

    A bit closer to PHP-NG,also am waiting for SitePoint to write an article on Yii 2.0 and what to expect. Good work Bruno as usual.

  • lucasrolff

    You say: “If you use shared hosting, ask them to upgrade. If they don’t have plans to do so, ditch them and show them you don’t support outdatedness.”

    I think you should rather say “please tell customers of webhosts to not run old shit software that isn’t supported by php 5.5, or 5.6”

    A webhosting company usually runs older versions of PHP because they have a lot of customers that runs software that doesn’t work in newer versions of PHP. I would gladly run the newest version of PHP on all servers I have, if I could tell the customer to update their software.

    Sadly that’s not possible.

    When looking on major software in this interwebs such as WordPress and Magento you’ll see that Magento just recently started to support php 5.4.

    WordPress relies on some MySQL_* functions in php which is deprecated, same time tons of other software relies on functions that is only in 5.3 and hopefully in 5.4.

    So stop bitching about hosts not running latest software, instead start bitching about the majority of customers who runs outdated software.

    Analysis shows that most self-hosted solutions such as wordpress, Magento and prestashop gets updated either because people don’t know how to update it or because they’re too lazy.

    • Agreed. Hence the last link in the post.

      • lucasrolff

        So you want to ‘ditch’ 80% of the open source projects in the world – sounds like a plan.
        Maybe instead you should be actively supporting those open source projects, and push them to update their code to support newer versions of PHP.

        Ooooor we could go back to static HTML pages :P

        • kitsmediatech

          Static HTML. I was just overcome with a wave of pleasant nostalgia. Life seemed so much easier

      • CTN

        Bruno, you’re coming across like a fanatic. calm down and stop waving your hands wildly. people will adopt when they’re good and ready and not because you say so.

        • You’re coming across like a fanatic for the opposite side, so I could argue the same. People will do what they will, and we’ll try to influence their opinion each in our own way

    • Ditch your host if they don’t upgrade to a first release of a php version? I read that and almost passed out. What a stupid statement Bruno just did. 5.4 and 5.5 work incredibly well. Shared boxes should be no lower than 5.4 and there is ZERO reason to believe that 5.6 would provide just as stable an experience for those users, in its current state.

    • Bryce

      Couldn’t agree with you more Lucas.

      This article is very deceiving to someone who doesn’t know better.

      While it does include a personal opinion, as a reliable resource that many people find SitePoint to be, this can be very deceiving and hurtful. I am also a hosting provider and run two servers. One with PHP5.4 and the other with PHP5.5 for those whom are interested in it. Forcing your clients to upgrade isn’t always possible and if we don’t take into consideration those clients, what better are we doing it?

      Magento is the leading ecommerce platform out there. I have dozens, if not more running it.

      I’d loose every one of those clients had I listened to your [the author] uneducated recommendations.

      You [the author] seem to be ignorant of the fact so many people run systems that can’t upgrade to a higher version of PHP. You’ll be turning your hosting company into a dictatorship and loosing clients.

      By far probably the worst article I’ve seen on SitePoint and I’ve been a long time fan of this website.

  • We’ve had this discussion in the other post already with dozens of people. Yes, I think we should ditch them. As pointless as it is to state this (but obviously necessary), it’s just my opinion.

  • Taylor Ren

    Something exists from the legacy time in history does not mean it still has every rationale to stay nowadays and beyond.

    Without a platform promoting the best and latest technology, people will tend to be lazy and reluctant to abandon the past and embrace the future.

    As a host of tons of sites, it is their responsibility to set the standard, which may not be the most advanced, but the most accepted AND most advanced. So in my view, a PHP 5.5 is a minimum requirement.

    Ditch them, definitely.

    • lucasrolff

      But again – look at Magento – one of the biggest ecommerce systems in the world – it doesn’t support PHP 5.5 yet – it’s less than 2 months ago it started to officially support PHP 5.4 with version 1.9.
      And you can find tons of other well used non-legacy software not supporting the newest versions of PHP – because one very specific thing – the releases of PHP major versions is going so fast, that a lot of developers can’t keep up changing and modifying their code – it’s not long ago that PHP 5.4 was officially released, then suddenly 5.5 pops out and then now 5.6

      There’s systems in this world that have been around for many many years – and has a huge codebase (Look through magento, WP etc ;) )
      Making sure that everything works is not that easy – but I’m pretty sure every experienced developer knows how it is to make big internal changes for their systems – and what amount of testing it requires.

      So surely in the ideal world – it would be nice if every project supported the newest version out of the box – but with the internal changes being done to PHP – very core functions getting removed (instead of making a pointer to another function – which by the way causes no overhead) – then maintaining codebases is not that easy. But you guys should know that.

    • CTN

      If you have invested in a particular framework, does it still make sense to ditch it if it does not immediately upgrade to the latest version of PHP?

      I don’t think so.

      5.6 is going to be run now on dedicated servers and VPSes by developers to check it out, and down the line, when people are finished testing their apps on it, they will begin to upgrade production servers to it, but not today.

      • Taylor Ren

        Not today is good enough. We know those guys are on the way and if there is a clear road map, it is OK to give them a grace period before the new platform is ready. But if there is no road map, and when you write to them asking for a one, the reply received is something vague and misty, why not abandon it?

        Tons of frameworks are there in the open market. Tons come and tons go. If the framework that is mentioned in your reply is not committed to embrace the new standard, new platform, my answer is still the same.

        • CTN

          I’m using the Fat Free Framework. minimum requirement is 5.3. I’m not about to drop it if it does not upgrade to 5.6 tomorrow. 5.3 is good enough. I’m still free to use 5.6 myself, if I want to.

  • For those on Ubuntu hosts, you might find the following Dockerfile handy to create a PHP 5.6.0 deb package for you automatically. :)

  • Michael

    BTW: the next version will be called PHP7, see At least that’s what it currently looks like :)

    • Keyword: currently :)

      • snikchnz

        I heard it straight from the horse’s mouth on Thursday that it will be PHP 7. In this case the horse == Rasmus.

  • I hope PHP will be best for server side web programming :)

  • CTN

    Doesn’t matter what you call it, it’s not going to be used on production servers until it’s been tested thoroughly first. You’ll see bug fixes coming for it over the next few weeks and months.

    • We’ll see bug reports and fixes until 5.6.0 hits end of life in 2017, nothing new. If you’re going to argue 5.6’s likely instability and unreliability, please provide us with evidence of any serious flaw, bug, or exploit found immediately after a production release.

      • CTN

        The point is that management will want to see if bugs are going to affect their app or not, not whether there are random bugs that have no effect.

        all software has bugs. risk management demands that we check if they affect us first before we commit to it.

  • Running Xenforo forum on PHP 5.6.0 GA release via Centmin Mod Nginx + PHP-FPM right now works nicely :)

  • Taylor Ren

    I think the discussion here got a bit off track.

    Magento, WP, are made for daily common usage. Compatibility is of concern. Or those running only 5.2 guys will not be able to run them in their shared host. So from a customer attraction and popularity view, I would do the same if I were the CEO of these platforms. There is nothing to blame on. It is a commercial decision.

    And after all, as you quoted, Magento started to move to 5.4, which is a good sign and in the right direction. We will encourage that and will urge them again, to move further ahead and don’t stop there. And I believe that such a movement is actually good in the sense that more and more hosts will start seriously thinking to enable higher versions of PHP. This is good for overall “level-up”.

    From another perspective, if you are an individual developer, and for example you are to use Symfony 2.x to start your app, how would it be if you find that the latest version of PHP you can use is only 5.1? You will ditch them, right? This happened to me when I found out that my BlueHost vhost only supports to 5.2 at that time when I just redo my web app with SF2. Luckily, BH upgraded the PHP installation in just about 2-3 weeks so I have the patience to retain there.

    Just my thoughts.

    • lucasrolff

      I agree – very old version of PHP is bad (5.2 is from 2006), 5.3 is from 2009 – IMO 5.4 is at this current moment a good version for hosts to support, there’s nice functionality, still compatibility issues with some software – but requiring hosts to run always the latest – is out of scope, and mainly due to legacy software.

      From a webhost perspective, we need to look at, which PHP version does most _current running_ software support – that’s most likely 5.3 and 5.4 – even software is still not fully compatible with 5.4 – so to be a host supporting large range of software that customers use – we can’t run the latest versions always.

      I would rarely blame the host from running old versions (some do it since they’re too lazy to upgrade) – others run semi-old, due to the fact that upgrading would break applications for a lot of their customers (e.g. 5.3 to 5.4 made big changes to sessions).

      At same time I believe that SF2 has full support for 5.4.. 5.5 or 5.6 is a nice to have – but most people will not benefit a lot from it, and thats what we should look at when looking from a hosting perspective.

      Sure there’s solutions out there that can provide multiple php versions on a server – but that doesn’t really solve the problem, IMO it makes it worse – since you’ll ‘allow’ customers to never update their software to support newer versions – which I find bad.

  • Great stuff, would be nice to see an article on how to use PHPDBG

  • Great reply. PHP was pretty stagnant for years and just recently its been moving extremely rapidly.

  • Fedor

    Wow, you give some of the worst advice possible under “What now?”…. I’m just speechless.

  • Taylor Ren

    Is it my overlooking? I can’t find any description on the internal operator overriding description in the PHP 5.6 release notice. It only mentioned GMP operator overriding, but that is not enough.

  • joefresco

    It’s clear Bruno is not ready to be a CTO. Stability matters more than a version because stuff has to work. PHP is a means to an end not an end to itself.

    Rule 1 to upgrading: Make sure the new version is actually better than the old one.

  • Jack Saat

    I can’t believe that Laravel and both Homestead and forge already got full PHP 5.6 support. I really think that Taylor Otwell is the best that happened to PHP in the last few years! Laravel seems to take PHP so much more closer to ruby and others. And really if you not did already contract Digital Ocean and maybe Laravel Forge! You will be in full control of your own host for a fraction of the price it will cost you elsewhere!

  • CTN

    I upgraded my server to php 5.6.0. do I get a cookie?

Get the latest in PHP, once a week, for free.