Main Content

Object Oriented Programming in PHP

Archive - Originally posted on "The Horse's Mouth" - 2004-09-29 07:12:22 - Graham Ellis

PHP started life as a language that was used for embedding simple executable content in a web page, and has grown rapidly into a fully fledged system - by release 4 (PHP4) it had become almost as flexible as as any other language for web based applications while retaining its ability to do simple web page inserts very easily. An Object Oriented model was introduced at PHP4, which sits on top of the other facilities of the language and, whilst it's good, has one or two quirks and limitations. Taking the background from which PHP came, the type of applications run, and the fact that OO was essentially bolted on the side, uptake / use of objects in PHP 4 has not been huge.

Our regular PHP course - a 4 day course introducing PHP for newcomers to the language - briefly mentions Object Orientation in PHP but goes no further - realistically, for most people the OO has been something that haven't wanted to use, and to learn both the principles and practise within a 4 day session in which you learn all the rest of PHP is a bit of a tall order.

With the release of PHP5, we have added a one day "Object Orientation in PHP" course to our schedule. It's for experienced existing PHP programmers who are probably NOT familiar with the principles of Object Orientation (or if they are, they've just learnt the theory and never used them fully in a practical application) and it covers:
a) The principles of Object Orientation
b) Object Orientation in PHP version 4
c) Object Orientation in PHP 5 (an extended syntax from PHP4)
d) A discussion of differences between the PHP4 and PHP5 model and how this effects code
If you're using PHP4, you'll find that some 80% to 85% of the material presented will be immediately relevant, and that the remaining section on PHP5 will both prepare you for the future and warn you of those aspects of OO in PHP 4 which might lead to the need for code modifications when you step up to PHP5