property and method scope Flashcards
1
Q
public
A
These properties are default when you are declaring a variable using the var or public keywords, or when a variable is implicitly declared the first time it is used. The keywords var and public are interchangeable because, although deprecated, var is retained for compatibility with previous versions of PHP. methods are assumed to be public by default.
2
Q
protected
A
These properties and methods (members) can be referenced only by the object’s class methods and those of any subclasses.
3
Q
private
A
These members can be referenced only by methods within the same class–not by subclasses.