Access Modifiers

Chapter 2 identified access modifiers as an essential element of an OO language. PHP 5 gives us everything we would expect in this area. In previous versions of PHP there was no support for data protection, meaning that all elements of a class were publicly accessible. This lack of access modifiers was probably the biggest disincentive to using objects in PHP 4.


Note:

A notion closely related to data protection is information hiding. Access modifiers make information hiding possible by exposing an interface (as defined in Chapter 2). This is also referred to as encapsulation of an object.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.192.3