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.

Comments

Popular posts from this blog

WP register_post_type() with custom CMB2 meta box

Git post receive setup at server for git push to the production from local machine