Zeev Suraski, one of the founders of PHP, said that the simplicity of this scripting language means it will be more popular than Java for building Web-based applications. About 22 million Web sites employ it, and usage is steadily increasing. The fact that PHP is an open source programming language makes a great case against its competitors. It has a cheap, fast, reliable and widely supported environment to run in; therefore it is mainly used in standard Web deployment, not only large enterprises.
The future of dynamic XML document construction with the PHP DOM is here. When working with XML-based applications, developers often find themselves facing the requirement to generate XML-encoded data structures on the fly. It will be possible, soon, to programmatically generate a complete well-formed XML document from scratch and save-it to disk
Java and PHP are drawing nearer to one another, though. Oracle, which also sells Java server software and whose database software can be used as a foundation for either Java or PHP, is among those working on an addition to Java to help the two software projects work together. Specifically, Java Specification Request 223 will "help build that bridge between the Java community and the PHP community", said Ken Jacobs, vice-president of product strategy at Oracle.
There are main new language features. The most basic and important change in PHP 5 is to use handles (or id's) for objects instead of implementing them as native data types. When copied, only the handle (the id number) itself is actually being copied; the objects these handles represent are not being copied.
This seemingly minor change in the semantics of the language is the major driving force behind the majority of the new PHP 5 features. It allows the addition of new language features and new PHP extensions, such as the great Simple XML that takes full advantage of the new semantics.
Without going into too much detail (or this article would become a book), the following is a list of new language features in PHP 5.
New object cloning semantics as mentioned, the scripting engine never automatically clones objects in PHP 5, whether they are assigned, passed by-value, or returned by-value from a function. If cloning is required, then the developer may explicitly clone an object by using the new clone keyword (for example, clone $obj
.
The developer may also implement a method named __clone() in his class, which will be called on the new resulting object, after the clone operation has copied all of the original object's properties. Implementing this callback is not required but can be useful if the developer wishes each object to have its own copy of a certain resource, thereby creating a new version of that resource for the cloned object (otherwise, both objects would be using the same resource).
Public /private /protected access modifiers: PHP 5 supports the PPP (Private /Public/ Protected) access modifiers commonly found in other object-oriented languages, such as C++ and Java. These access modifiers may be used on both properties and methods, and impose access restrictions. Other extensions that take advantage of this ability include the Simple XML, SOAP, and Perl extensions.
PHP5 is going down the road of Java and copying its object model and other ideas.
That’s no bad thing but most PHP developers surveyed don’t want that. Adoption of PHP4 was much faster than PHP5 is, possibly because there was such a huge difference between versions 3 and 4. If PHP5 features were really “must haves” then people would be crying out for them.
C++ will be around for a long time. It’ll be used forever by embedded systems programmers and programmers who write traditional kinds of apps. But for those of us who write Web apps, C++ will become an anachronism.