What ’s New in PHP5?

So what’s the big deal about PHP5? If you’re experienced with PHP4, you probably know about object-oriented programming and the way this was handled with PHP4. If you’re unfamiliar with PHP, but you’re familiar with other programming languages, you’ll probably find PHP5’s imple- mentation of object-oriented principles familiar. Luckily, things have become a lot easier with the release of PHP5. However, there are other improvements and changes, such as more configuration options in php.ini and a host of new array-related and other functions, besides just “better object- oriented programming” handling. This chapter outlines these changes for you.

Object-Oriented Changes

The changes that follow relate to the OOP model and associated features and related topics. The majority of these changes are covered in greater detail in Chapter 2, but are also briefly outlined here for your quick reference.

Passing Objects

One big impact of OOP changes in PHP5 is the way that variables are passed as parameters to func- tions. In PHP4, by default, variables were passed by value instead of by reference, unless denoted otherwise with the syntax &$varname. In PHP5, the default is to assign a value by reference.