Are you looking forward to seeing the future of PHP from the draft design blueprint of ZendEngine2.0. First of all, some miscellaneous are the original intention of this article. I have obtained the design blueprint document for ZendEngine2.0 for some time. (now, you can download the document from the address in the reference documents. First of all, it is the original intention of 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, so let's leave it for the moment. 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 an 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. The Zend Engine 2.0 design blueprint (draft) clearly shows from the design blueprint (draft) 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: from a positive perspective, today's programming world is more welcome to languages with object-oriented features (even if the language itself is not built on the basis of object-oriented, 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 the open source code and cross-platform programming, it is also important to adapt to the simple and fast web programming features built by Internet sites. 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? The above are some of my "objective" analysis-the so-called "objective", that is, to disguise myself as a loyal supporter of Zend Engine 2.0 when writing positive information; when writing negative information, it is the opposite (I hope you will feel objective after reading my analysis ). However, "objective" is actually just a foreshadowing for my "subjective" argument-the key to the problem-what do we expect PHP to look like in the future? In fact, the key to the problem may be the direction in which PHP will be expected, or the field in which PHP will be committed. The reason why PHP is so popular, especially when there is almost no commercial support (Zend currently provides support for PHP, but it is really insignificant compared with Microsoft and Sun .) It becomes a programming language that can compete with ASP and JSP, because it is completely oriented to a realistic and fast web programming environment. This situation can be clearly seen in many PHP tutorials-to implement some common web functions, using PHP often means less code and complexity; at the same time, for programming in a specific field, PHP also has extended module functions available (although there is no commercial support, PHP has the support of a large number of open-source software advocates, they not only contributed to the generation and development of PHP, but also provided various extension module functions .), In this way, more immediately available and free function libraries mean less workload for developers. all you need to do is read the function manual and use them properly. PHP competitors seem to be somewhat "knowledgeable"-inflexible and rigorous. maybe the products of large commercial companies are less convenient to use than hackers are. However, in order to adapt to the real Rapid web programming environment, PHP gave up some things when focusing on ease of use: for example, the developer's own module writing and encapsulation (non-source code level ), and object-oriented features (the existing version only does not fully support some of the features)-but what these PHP lacks is what their competitors possess (for example, ASP can communicate with COM components, JSP can easily use Java Bean. JSP is originated from Java, a fully object-oriented language, and so on. Therefore, PHP is usually excluded from the candidate list for building enterprise-level applications. The core of the problem has been quite clear-the current development of PHP has encountered a cross-cutting Road: continue to give full play to the characteristics of your fast web programming language, or is it possible to complete and modify itself into a programming language that meets the needs of a serious business environment? From the perspective of the Zend Engine 2.0 design blueprint, the creation maintainers of PHP seem to have chosen the next policy-almost rewriting the object-oriented model of the interpretation Engine, enhance language object-oriented features. I personally think this option has some reason: PHP seems to have done well in adapting to fast web programming, based on the existing language architecture, it is impossible to make too much changes in this aspect (only modifications, additions and deletions of some core functions, and step-by-step addition of more extension function libraries ), PHP must develop ...... J. most people are aware of the limitations of PHP, and its creation and maintenance personnel are more clear-if PHP can be paid attention to in enterprise-level applications, that would be a bigger victory (for open-source software advocates, it may be more meaningful ). The shortcut to improving its competitiveness in this field may be the content presented in the Zend Engine 2.0 design blueprint-adding a new object-oriented model for this process-oriented language to the traditional language, this allows developers to easily adopt object-oriented programming methods. However, it is a pity that there are still too many PHP attempts to enter the enterprise-level computing field-there is not enough commercial support, A large number of expansion modules are in the experimental stage, and some of them need to be used to take responsibility for enterprise-level applications, and lack of planning and support for system architecture, perhaps the most important thing is whether the idea of the business community can accept open source rather than commercial-supported programming languages to build the entire business system (however, Linux applications seem to be showing bright prospects, but it is only the prospect ). Even optimistic PHP supporters (like myself) are skeptical about using PHP in enterprise-level computing-even after Zend Engine 2.0 was launched, as stated in the design blueprint. Therefore, I do not have much hope for the new version of PHP using Zend Engine 2.0: its application lies in the rapid web programming environment, such as the Internet site; choosing PHP as the main supporting language for building key business systems requires great caution. Although Zend Engine 2.0 focuses on strengthening the object-oriented feature (maybe the creation and maintenance personnel of PHP will strongly advocate using them), for most existing PHP developers, writing PHP programs in the current process-oriented style will not be affected (Zend Engine 2.0 is also very considerate to consider the problem of backward compatibility)-that is to say, on the surface, PHP is more powerful because it is given the object-oriented features. In fact, Zend Engine 2.0 and 1.0 are used by most developers (supporting the interpretation Engine of PHP 4) PHP is no different. Of course there are still some areas worth looking forward to: the rapid web programming environment also requires good modeling, and the object-oriented design and implementation is much better than the process-oriented or page-oriented approach. Some PHP developers (including the creation maintainers of PHP) are already advocating the use of language object-oriented features (PEAR is a good example ), zend Engine 2.0 will bring them the gospel-a better object-oriented model, object-oriented design and implementation can be almost unrestricted (currently, PHP cannot do this because of its extremely incomplete object-oriented support ); at the same time, the object performance can be improved. The introduction of the violation handling mechanism will have a positive impact on PHP projects, which can effectively improve code efficiency and encourage proper error handling. The improved object-oriented model of Zend Engine 2.0 makes it more convenient and reasonable for PHP to call external components (such as COM and Java Bean) and improves the efficiency. This improvement may increase the possibility of using PHP as a front-end for heterogeneous systems (such as systems developed using Java) (the domestic mini J2EE project is a typical example of this ). Some suggestions for PHP developers first you don't need to worry about the future of PHP-your development skills are still applicable and work well in the new version (this makes me think of Microsoft. the embarrassing position of Visual Basic in. net -- PHP won't ). Even if you do not know anything about object orientation, you can develop it in the traditional way (also the technology introduced in most books on PHP development on the market. Second, if you are interested in PHP's object-oriented features, or you have actively explored the features, in the future, PHP will be more suitable for your taste-you can use the object-oriented method for project analysis, however
Attention is the first 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...