Hui Xinchen is the most influential PHP technical expert in China, a core member of the PHP development team, a PECL developer, and an external consultant at Zend Technologies. He previously worked at Yahoo and Baidu, and is now the Chief Architect of the Platform and Data Department and Chief PHP Consultant at Sina Weibo. Hui Xinchen is a core developer of PHP NG and a major developer of PHP 5.4 and 5.5. As a PECL developer, he contributed multiple outstanding open-source projects including Yaf, Yar, Yac, and Taint, and is also a maintainer of projects such as APC, OPcache, and Msgpack.

From a beginner searching for PHP tutorials online to a core member of the PHP development team, Hui Xinchen feels the whole process was like "leveling up by defeating monsters." PHP, like Java, is also called a blue-collar language, but in his view it is precisely the cradle that can cultivate more programmers, and in an era when everyone can code, it is bound to produce more outstanding people who can drive technological progress.

Question: How did you become interested in programming?

My first "programming" was probably on a Subor learning console. Later, I studied computer science in college, and during graduate school I was responsible for campus informatization construction. I did a lot of web development work, actively or passively, including websites for many secondary departments of the school and maintenance of the campus BBS. Thinking about it, there doesn't seem to have been a single event or moment when I said I fell in love with programming. It just felt natural to enter this industry, and I didn't dislike it, so I kept doing it.

Question: How did you come to like PHP? And how did you become a core member of the PHP development team?

At the time, during graduate school, I needed to build a website. I had no idea how, so I searched online and happened to find a PHP tutorial about how to make a simple website. I tried following it and found that installation, deployment (there were no centralized deployment tools then, though there were also many tutorials on deploying LAMP), coding, and testing were all very convenient. The syntax was also very similar to C, and even many API names were the same as those in the libc API. And so my inseparable bond with PHP began.

It was probably in 2011. At that time I developed Ap (the predecessor project of Yaf) for Baidu. It was used quite well within Baidu, so I thought about contributing it to PECL. After making some modifications, I renamed it Yaf (Yet Another Framework — the name is a bit self-deprecating, because there are already many PHP frameworks). I sent an email to the PHP mailing list. Because my English was pretty poor, the process was quite tortuous. Fortunately, Pierre Joye helped me a lot, which allowed Yaf to enter PECL.

Also, before submitting Yaf, I had actually been studying PHP's source code all along, so I had submitted quite a few bug reports and fixes. For example, I remember one day at noon, Rasmus (the father of PHP) said on IRC that he had found a bug, and I gave a fix about five minutes later.

After gradually getting to know some people and earning everyone's trust, I submitted an application. Then I obtained commit access to the PHP core code, participated in PHP's direct development and bug fixes, and became a member of the development team.

As for being a core member, that was accumulated slowly; it was actually a process of mutual trust. If your work is recognized by others, they will respect your opinions. I gradually became familiar with Dmitry Stogov, obtained commit access to the core part of Zend, submitted many core bug fixes and new features, and later became an external consultant at Zend, gradually becoming a Core Developer.

It sounds a bit like leveling up by fighting monsters, doesn't it?

Question: What was the opportunity that led you to develop Yaf? How did Baidu support Yaf's development at the time?

Before Yaf, there had always been a classic debate about whether to use frameworks: "Using a framework reduces performance, while not using a framework reduces development efficiency."

At that time, there were many frameworks within Baidu, including open-source ones like Yii and ZF, as well as some written by individual teams. One problem was that class libraries and some supporting infrastructure could not interoperate.

Another reason was that after many framework authors released their frameworks, they found that different people would make various modifications to the framework, so over time, once a framework was released, it would turn into many variants, making subsequent unified upgrades impossible.

So I decided to implement a framework as a PHP extension to solve these problems. Of course, before writing the extension, I wasn't really confident and didn't know how much performance improvement an extension could bring. Fortunately, the final result was very good.

Question: Why did you choose to write Yaf in C?

PHP is written in C, so its extensions are also written in C. Thus I chose C to write Yaf.

Question: Why did you leave Baidu and come to Sina Weibo?

There were actually many reasons. For example, at Baidu I had reached T7, and I was less involved in business matters. I felt like I didn't have that much to do, and it seemed I was somewhat wasting time.

Also, at the time I was in Baidu's commercial search department and didn't directly work with high-traffic systems, so I also hoped to find a larger platform to further train myself. Weibo happened to be exactly such a platform.

After coming to Weibo, I indeed encountered many challenges I had never faced before, and I also felt that my knowledge had a bigger stage on which to be applied.

Question: What specific work are you responsible for now at Sina Weibo?

I am now in Weibo's Technology Department, leading a basic services team. Our main work is also carried out in stages. For the first two years, the main work was performance optimization of Weibo's LAMP stack, including various basic frameworks, tool development, environment optimization, and standard formulation.

Over the past two years, Weibo's LAMP architecture has become more stable, and overall performance has improved several-fold. We also have our own high-performance LAMP overall solution. So the LAMP optimization work has decreased somewhat. Now our main energy is focused on infrastructure research and development, such as the cache middleware layer, transcoding services, communication platforms, and so on.

Question: Did PHP 7 (PHPNG) take Sina Weibo's needs and pain points when using PHP as important feedback?

Of course, yes. Since I joined the development team, I have had similar debates with many other members: I think performance is very important, while some think new features are very important. So when a new feature affects performance, we have arguments.

I am very obsessive about performance improvements. That is also why I later cooperated more with Dmitry Stogov, because he also cares particularly about performance.

The main reason I care about performance is that I have a very real appreciation of the value that every 1% performance improvement can bring to a platform like Weibo, the largest LNMP platform in China. Although Weibo's overall performance has greatly improved compared with two years ago, I realize that without affecting development efficiency, further improvements can only depend on performance improvements in the language and environment. This part is also Weibo's demand on PHP.

Compared with PHP 5.6, PHP 7 has more than 100% real performance improvement (QPS) on WordPress. I believe that next year, after PHP 7 is released, all businesses on Weibo's overall LAMP platform can also achieve a 100% performance improvement.

Question: What was the process of your participation in PHP 7 (PHPNG) development? How did you cooperate with other development team members?

PHPNG was a secret project at the time. The initial participants were only Dmitry and me. I remember it was early spring this year. At that time, the JIT project we were working on based on PHP 5 was shelved because the results were not satisfactory, and everyone was quite down.

Dmitry said he had an idea: redesign ZVAL and compress its size to reduce memory usage. Then the two of us discussed it. Because in fact we have all kinds of ideas every day, at the time we just thought: "Hmm, this idea might work." But we weren't very confident.

The main idea at the time was to quickly make a runnable prototype to test the effect. During this process, we mainly discussed ideas, then each implemented our own parts, and then merged them.

The main tool for collaboration was still Skype. However, because he is in St. Petersburg and there is a time difference with us, we also communicated via email and reviewed code through GitHub.

Later, when the project had nearly reached a conclusion, we found, "Hey, this idea is good, it works." Then we made it public. After that, it became the normal collaboration model: if you have an idea, submit an RFC, submit a patch, vote, everyone reviews, and then merge.

Question: What features have been added or removed in PHP 7 so far? Before release, how will performance be further improved?

There are many. Besides the PHPNG branch mainly providing performance improvements, we also have support for AST (Abstract Syntax Tree), uniform variable syntax, support for 64-bit length strings, some new syntactic sugar, and more recently Native TLS, among others.

PHP 7 will be officially released in October 2015. Before that, we still have some ideas to try, for example, using zend_array to directly replace Hashtable; for example, reducing iTLB misses by specifying function re-sectioning and ordering; for example, introducing some of JIT's optimization techniques (type inference) into PHP, combined with some type-specific opcode handlers to speed things up; and for example, further improving code and data locality to reduce cache misses, and so on.

Of course, we also have a JIT project being done in parallel. It's just that I'm worried about whether this project can be ready by the time PHP 7 is released.

Question: Will the new version of PHP skip PHP 6 and go directly to PHP 7? Why?

The main reason is that PHP once had a development version called PHP 6, but that version later failed and was never released. So this new version should be PHP 7.

Q: What is the relationship between Hack, the language released by Facebook, and PHP? Is the purpose of Hack to replace PHP? What are the respective advantages of these two languages compared with each other?

There's not much of a relationship; Hack is not PHP. As for replacing PHP, I believe they (Facebook) might have that idea, but it depends on whether the community accepts it or not.

I'm not particularly familiar with Hack, so it's hard for me to comment specifically.

Q: Some people think that because PHP is easy to learn and has a low barrier to entry, it has attracted people who are not really suited for programming. What do you think of this view?

I really can't agree with this view. When I graduated from undergraduate studies, I also tried to find some development jobs, interviewed at several companies, and was rejected by all of them. Perhaps in the eyes of the people who interviewed me at that time, I was someone not suited for programming.

But because PHP has a low barrier to entry, it allows people to quickly see the results of their "programming," which creates a positive feedback incentive for beginners and makes those who are interested even more interested. And the more people who program, the greater the probability that there will be experts and people who contribute to the advancement of technology as a whole.

Moreover, programming languages in the future will definitely move toward ease of use, further lowering the barrier to programming. Perhaps one day everyone will be able to program, who knows!

Q: What should the knowledge structure of a qualified PHP engineer look like?

I remember an old saying: "PHP engineers are jacks-of-all-trades." Actually, this saying doesn't just apply to PHP engineers; it should apply to all engineers.

The knowledge structure needs to be very broad. Web development involves quite a few technical areas. Besides HTML, CSS, JS, and SQL, you also need to know some common methods for configuring, maintaining, and troubleshooting Nginx, Linux, and MySQL. You should know a bit about all of these.

Q: Besides technical ability, what else do you focus on during interviews?

I pay special attention to clarity of thinking, communication, and manner of speaking. Essentially, if we're going to work together in the future, I want to know whether there will be obstacles, and whether the potential for growth is great.

Q: Chen Bole, the former webmaster of phpe.net, is now selling men's socks. What are your plans for the future? Will you always be a coder?

Actually, I'm a very lazy person. I never think too far ahead; I live for the moment. So I'm not really sure about the future either. I just feel that right now I still like programming, and I like making my work benefit everyone and earning the praise of the community. I think that's great, so I'll keep doing it.

Source: http://www.ituring.com.cn/article/142454