Ads 468x60px

Thursday, July 28, 2011

What's New in PHP4?

What's New in PHP4?

PHP4 introduces numerous new features that will make the programmer's life more
interesting. Let's take a quick look at some of them.
A new foreach statement, similar to that found in Perl, makes it much easier to
loop through arrays. We will be using this for most of the array examples in this
book. Additionally, a raft of new array functions have been added, making arrays
easier to manipulate.
The language now includes the boolean data type.
A particularly useful feature of PHP3 was the capability to name form elements
as if they were elements in an array. The elements' names and values are then
made available to the code in array form. This feature has been extended to
support multidimensional arrays.
Support for object-oriented programming was somewhat rudimentary in PHP.
This is significantly extended in PHP4; for example, it is now possible to call an
overridden method from a child class.
PHP4 now provides native support for user sessions, using both cookies and the
query string. You can now "register" a variable with a session, and then access
the same variable name and value in subsequent user requests.
A new comparison operator (===) has been introduced that tests for
equivalence of type as well as equivalence of value.
New associative arrays containing server and environmental variables have
been made available, as well as a variable that holds information about uploaded
PHP4 now provides built-in support for both Java and XML.
Although these and other features significantly improve the language, perhaps the
most significant change has taken place under the hood


Post a Comment