Access Specifiers in PHP
There are 3 types of Access Specifiers available in PHP, Public, Private and Protected.
Public - class members with this access modifier will be publicly accessible from anywhere, even from outside the scope of the class.
Private - class members with this keyword will be accessed within the class itself. It protects members from outside class access with the reference of the class instance.
Protected - same as private, except by allowing subclasses to access protected superclass members.
EXAMPLE 1: Public
EXAMPLE 2: Private
EXAMPLE 3: Protected
EXAMPLE 4: Public,Private and Protected
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week