What is access specifiers in php?

143 Views

What is access specifiers in php?

Access specifiers

An access specifier is a code element which is used to determine which part of the program is allowed to access a particular variable or other information.

 

There are three types of access specifiers available in PHP they are:

  1. Private: Members of a class are declared as private and they can be accessed only from that class.
  2. Protected: The class members declared as protected can be accessed from that class or from the inherited class.
  3. Public: The class members declared as public can be accessed from everywhere.
Tags:-
PHP
Codeigniter