In PHP4 the only constants that we would declare were global constants. In PHP5, it is possible to define a class level constant. These constants are specific to the class and hence don’t clutter the global level constant space. (more…)
Access specifiers specify the level of access that the outside world have on the class methods and class data members. Access specifiers can either be public, private or protected.
Why do we need Access specifiers
Access specifiers are used as a key component of Encapsulation and Data Hiding. By using either of the access specifiers mentioned above i.e. public, private or protected you can hide or show the internals of your class to the outside world. (more…)