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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

protected

A

These properties and methods (members) can be referenced only by the object’s class methods and those of any subclasses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

private

A

These members can be referenced only by methods within the same class–not by subclasses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly