whenpenguinsattack.com

Wednesday, February 22, 2006

why use php5?

By Justin Silverton

New Object-orientated features

In the previous versions of PHP, objects and classes were supported, but only on a limited basis. Missing was the ability to de-reference objects that are returned from a method and implicit object cloning resulted in unexpected behavior.

The following are new features within php5

A) Public, private, protected class modifiers

These modifiers may be used on both properties and methods, and restrict access.

B) Interfaces and abstract classes and methods.

C) Object cloning

The scripting engine never automatically clones objects in PHP 5, whether they are assigned, passed by-value, or returned by-value. If you do need to clone an object, then you can use the following syntax: "clone $newobject" or a method called __clone() can be implemented, which will be called after an object's properties has been cloned.


D) Design Patterns


Supported in PHP 4, but now has new and improved features such as static properties and methods, private/public/protected modifiers, and interfaces.

E) XML and Soap

The soap protocol is becoming increasingly popular for communicating with web services. Many companies are implementing it to allow for easy access to data.

Improved mysql functionality

A new library, called mysqli, offers the following improvements over the old library:

A) SSL connectivity
B) prepared statements
C) Bound Input and Out parameters
D) Object orientated interface

Exception Handling

Exceptions allow you to have a greater degree of control over error handling, by separating the program logic. You no longer have to check the return value from a function.


Complete function list can be found here

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home