Access Specifiers in PHPThere 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: PublicOutput: EXAMPLE 2: PrivateOutput: EXAMPLE 3: ProtectedOutput: EXAMPLE 4: Public,Private and ProtectedOutput: Next TopicPHP OOPs Const keyword |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India