25.09.2014 Views

ZEND PHP 5 Certification STUDY GUIDE

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 6<br />

Object Oriented Programming in<br />

<strong>PHP</strong><br />

Object orientation is probably the area that has been subject to the most significant<br />

and far-reaching changes with the advent of <strong>PHP</strong> 5. Rather than making things<br />

incompatible with previous versions of the language, however, they enhance <strong>PHP</strong><br />

4’s meagre OOP offerings and make <strong>PHP</strong> 5 a fully functional object-oriented language—plus,<br />

of course, they make your life easier.<br />

OOP Fundamentals<br />

While the goal of this chapter is not to provide a guide to the concepts of objectoriented<br />

programming, it’s a good idea to take a quick look at some of the fundamentals.<br />

OOP revolves around the concept of grouping code and data together in logical<br />

units called classes. This process is usually referred to as encapsulation, or information<br />

hiding, since its goal is that of dividing an application into separate entities<br />

whose internal components can change without altering their external interfaces.<br />

Thus, classes are essentially a representation of a set of functions (also called methods)<br />

and variables (called properties) designed to work together and to provide a specific<br />

interface to the outside world. It is important to understand that classes are<br />

Licensed to 482634 - Amber Barrow (itsadmin@deakin.edu.au)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!