Encapsulation (computer programming): Difference between revisions

Content deleted Content added
m Reverted 1 edit by 65.112.194.226 (talk) to last revision by Naasking. (TW)
Scope's a feature in many prog languages and saying PHP "offers the advantage of plain and simple" is bias. Plus wording is awkward English and scope is covered in detail on its page: Scope (computer science). Disagree? User talk:Simply Habit'
Line 57:
}
</source>
PHP offers the advantage of plain and simple. The purpose of these 3 categories is SCOPE.
* Public - The method is publicly available and can be accessed by all subclasses.
* Protected - the method/function/property is available to the parent class and all inheriting classes or we call them subclasses or child classes.
* Private - the method is private and only available to the parent class/base class.
 
Below is an example in PHP: