Press "Enter" to skip to content

Some Words on the Release of PHP 7

This is a piece of reflection I originally wrote for my WeChat account. I suddenly realized my blog hadn't been updated in ages, and found myself musing that, the way products are developing these days, personal blogs seem to have less and less of a reason to exist... Sigh. Anyway, after making a few edits, I've republished it here.

I've been doing open source for four or five years now. From Yaf in the beginning to PHP 7 today, I've been involved in more and more projects, and more and more people use my code. PHP 7, released yesterday, is without question the most important milestone of my open-source career. I should mark the day — so let me allow myself to be a little sentimental.

The PHP 7 project began around last Spring Festival. At that point, our Opcache JIT effort on top of PHP 5.5 had effectively been shelved, because it simply wasn't getting us the results we'd hoped for. Some of what we'd learned while working on JIT made us realize the foundations weren't strong enough to properly support it. So somewhere around February 2014, we kicked off a refactoring project. The hope at the time was that a ground-up rewrite would yield a 30%+ performance gain and lay the groundwork for further optimization down the line.

The project didn't have a name back then — we were just experimenting. Those few months were the busiest of my life, because it was only the two of us (Dmitry and me) on it, and I was already swamped with my day job at Weibo, so I pretty much poured every evening into it. It helped that the other person and I were five hours apart in time zones, which let us chain a lot of the work end to end.

As the project moved forward, we were delighted to find the performance gains were even bigger than we'd imagined. By April, the other person (Nikic) had joined as well and the pace picked up considerably. By May most of the work was done, so we made the result public and gave it a name: the PHP NG project.

What I didn't anticipate was the heavy resistance from the community. While we'd been building PHP NG in secret, the community was running in parallel a 64-bit support effort, largely driven by Microsoft folks. When PHP NG went public, some pushed back: suddenly a patch of this magnitude shows up, no one else understands it, how will it be maintained, how will it be merged with the 64-bit branch, and so on. From there it slid into outright opposition to adopting the PHP NG branch. I was deeply frustrated at the time, and the argument went on so long that it wore me out. In the end I couldn't hold it in any longer and, not even caring how broken my English was, fired off a venting mail to the list urging everyone to value this performance branch.

There was also a genuinely funny subplot. A lot of people supported PHP NG, and they were fed up with the bickering too. One day, a group of supporters posted this item on the official PHP news page: http://php.net/archive/2014.php#id2014-05-27-1, which said, in part, "When we aren't looking for pictures of kittens on the internet, internals developers are nearly always looking for ways to improve PHP, a few developers have a focus on performance." But that very same day the objectors came in and said it couldn't stand, since PHP NG hadn't been accepted yet, and demanded the article be pulled. Since it had already gone out, the compromise was to simply remove the link from the front page and keep the content only in the archive. A fair few outlets caught on to the whole fiasco.

When the debate stalled out, we had no choice but to call a vote on whether to accept PHP NG. In the end, the overwhelming majority came down in favor, and it was decided that the next version of PHP would be built on top of PHP NG. We hadn't yet settled on calling it PHP 6 or PHP 7 (that was later decided by vote — PHP 7 won). I still bring up this experience a lot; it's what first let me feel what people mean by the "pains of democracy."

What happened after that is something everyone has since been able to watch. Over the nearly two years that followed, a steady stream of new features landed, performance kept climbing, and a lot of long-standing oddities were cleaned up — all of it folded into PHP 7, making the release richer and more complete with every passing month. From the ground-up rework of the zval down to scalar type hints, from an initial 30% speedup to a performance leap of well over 100%, every change has been one worth waiting for. And after a few reluctant slips, here we are — today, all of it finally lands in front of you.

Sometimes I think about how lucky I've been. Lucky always to get the chance to take on work I'd never done before, work that stretches me. Lucky that I can still feel myself growing. Lucky that most of the effort I've put in has, in the end, shown results and been rewarded. And I sincerely hope my luck can nudge a few more people toward open source.

Going forward, we'll keep doing what we've always done: pushing PHP's performance and quality forward, so that more PHPers can keep enjoying improvements that are real and transparent.

Last of all, after all these years in open source, it's given me so much. I want to thank everyone — thank you for the encouragement, and thank you too for the kind, generous overpraising.

Thanks

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.