First of all, some miscellaneous are the original intention of this article. I have been getting the design blueprint document for ZendEngine2.0 for some time (now you can download it from the reference URL ), after reading this article, I had the urge to write a comment-because the next generation of PHP will be a language better suited to the existing object-oriented development habits, at least it is given more object-oriented features. However, the problem that arises is that PHP can be quickly enabled on the Web.
Some Miscellaneous
The first is the original intention of writing this article. I have obtained the design blueprint document for Zend Engine 2.0 for some time (now you can download it from the reference URL ), after reading this article, I had the urge to write a comment-because the next generation of PHP will be a language better suited to the existing object-oriented development habits, at least it is given more object-oriented features. However, the question that arises is, is it worthwhile for PHP, such a language with the initial goal of rapid Web development, to be fully qualified? This question seems to need some comments to discuss, and I am very willing to put forward my own point of view. However, after some busy things, the impulse was moved back to his stomach a little bit, and I remembered it some time ago. so I read the design blueprint document several times and read this article. (When I first got this English document, I still had the intention to translate this design blueprint document into Chinese, but considering that it was not the final blueprint, second, everyone should cultivate the habit of directly reading the original text. third, translation always inevitably brings some obscure places. However, when writing this article, I decided to translate the article "adventure" once. if you cannot reach your purpose accurately, please correct it .)
The second is the explanation of the focus of this article-in this comment, I will mainly comment on the object-oriented features that will be greatly enhanced in PHP in the future. If you are a PHP developer, I guess you should understand some object-oriented features in PHP; however, PHP is generally used in an "extremely fast development environment" (this is a word I made myself, indicating the development of customer-oriented websites, it is characterized by a very short schedule and unclear customer requirements), so there are not many developers and development projects that really use the object features in large quantities. In addition, the current PHP object model is inferior to C ++ and Java, and limits the use of this feature. However, in future PHP versions, the focus of the modification is on the object-oriented model in the language, which improves many of the bad features in the current version and adds other features. Therefore, the future of PHP is focused on the object-oriented features of PHP.
Well, let's get to the point and look at the new features of Zend Engine 2.0.
Design Blueprint (draft) for Zend Engine 2.0)
From the design blueprint (draft), we can clearly see that the next generation Zend Engine is based on the new object-oriented model. If you have used the object-oriented features of PHP 4, it may feel awkward while finding a little bit of Java or C ++-not only the lack of object-oriented syntax, and sometimes unexpected running results-all of this is caused by a less elegant object-oriented model in the existing Zend Engine 1.0 that supports PHP 4.
To put it simply, the next generation of Zend Engine will move closer to Java and draw a lot from its object-oriented model. The improved features can be divided into three types: the first type is the improvement and enhancement of the existing object-oriented model, including the definition of the builder and the destructor, added object-oriented features such as private member variables, static member variables, multi-inheritance, and overload. The second type is modification and addition and deletion of control processes, for example, a try/catch/throw violation handling mechanism is added; the third type is about function modification and addition/deletion, for example, adding a function to the string offset. (For details about each type of improvement, see the documents listed in references .) From this we can see that through the first and second types of improvement, PHP is gradually improving itself into a language with object-oriented features.
However, the problem arises exactly here:
In a positive aspect, today's programming world welcomes languages with object-oriented features (even though the language itself is not built on the object-oriented basis, you can also add defined objects to prevent the language from falling behind the trend.) -- In this sense, zend Engine 2.0 makes PHP's support for object-oriented development more consistent with the development trend of programming languages, when building enterprise-level applications (which is often accused of PHP today), using object-oriented modeling and implementation is already a de facto standard, this improvement of PHP may cater to this need and solve the weakness of the language itself in this aspect.
In the negative aspect, it seems meaningless to provide developers with a new version of PHP that is more similar to Java. The reason why PHP is widely used is that, apart from open source code and cross-platform programming, PHP can adapt to the simple and fast web programming built on the Internet site (which occupies a large proportion in current program development) the features are also important. Extremely short learning time, friendly language style (especially if you are familiar with C), and a large number of extended class library functions are enough to prove its strength; however, if we transform the next version of such a language into an object-oriented language, it will not only make a large number of original developers at a loss in a short time, and it is not conducive to attracting new developers to join. since there is a language like Java, why should we study PHP?