The three modifiers public, protected, and private are the access control mechanisms introduced in php5. By using modifiers, developers can restrict access to members in a class. Literally, these three modifiers are translated into Chinese as public, protected, and private. Let's use code examples to see how public, protected, and private restrict members in a class.
Public access modifier public
The public modifier has no access restrictions on members in the class, and all external members can access members in this class.
<?php class myclass{ public $public