Visibility of PHP properties and methods
Appearance
![]() | Template:Wikify is deprecated. Please use a more specific cleanup template as listed in the documentation. |
![]() | This article provides insufficient context for those unfamiliar with the subject. |
An editor has determined that sufficient sources exist to establish the subject's notability. |
![]() |
The visibility of PHP properties and methods refers to visibility in PHP. It is defined using the keywords "public," "private," and "protected." The default is public, if only var is used; "var" is a synonym for "public." Public declared items can be accessed everywhere. Protected limits access to inherited classes (and to the class that defines the item). Private limits visibility only to the class that defines the item.[1] Objects of the same type have access to each others private and protected members even though they are not the same instances. PHP's member visibility has sometimes been described as "highly useful,"[2] However, they have also been described as "at best irrelevant and at worst positively harmful."[3]