Home >Backend Development >PHP Tutorial >PHP access modifiers

PHP access modifiers

WBOY
WBOYOriginal
2016-07-29 09:02:37922browse

You can add three modifiers to the members (properties, methods, class constants) in the class for permission access.

The location where access is requested can be divided into:

  1. Internal of a certain class
  2. Internal of a parent/child class with inheritance relationship
  3. External of a certain class

public public, shared, public {1, 2, 3}

  • Accessible from anywhere

protected The {1}

  • cannot access the private members of the parent class on a protected basis
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i

').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces the access modifiers of PHP, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn