PHP Public, Private, Protected
In php (object oriented programming) you can define three types of variable in class. Usually variable in class is called by operator.
Three types are public,private,and protected.
public : When you will define public type. You can access it anywhere. Inside of it's own class or another class or outside of the class.
protected : When you will define protected type. You can access it only in class. Not only in it's own class but also it can access in another class but never outside the class protected type is accessible.
private : Private is the most secure type. It is only accessible in it's own class. And not accessible neither other class nor outside of any class.
Three types are public,private,and protected.
public : When you will define public type. You can access it anywhere. Inside of it's own class or another class or outside of the class.
protected : When you will define protected type. You can access it only in class. Not only in it's own class but also it can access in another class but never outside the class protected type is accessible.
private : Private is the most secure type. It is only accessible in it's own class. And not accessible neither other class nor outside of any class.
Comments
Post a Comment