marcov4lente
3/7/2015 - 2:41 PM

PHP class and method visibility.

PHP class and method visibility.

###Public

  • Accessible from within it's class.
  • Accessible from another that has extended its class.
  • Accessible externally, via the instance.

###Protected

  • Accessible from within it's class.
  • Accessible from another that has extended its class.
  • Not accessible externally, via the instance.

###Private

  • Accessible from within it's class.
  • Not accessible from another that has extended its class.
  • Not accessible externally, via the instance.