- Access Modifiers 6:04
- Access 3 questions
- Associative Arrays 7:36
- Cleaning Up the Class 2:58
- Accessing Arrays 5 objectives
- Adding Getters and Setters 8:32
- Ready Get Set Go 5 questions
- Static Methods 4:52
- Recipe Details 3:16
- Separating Methods 2:43
- Static 4 objectives
- Magic Methods 5:05
- Magic Constants 6:14
- All About the Magic 5 questions
- Populating the Recipes 3:15
- Controlling the Class 3 objectives
Quiz Question 1 of 5
We have a public property named "languages" that is an array. Which of the following methods is valid for adding an element to the array?
Choose the correct answer below:
-
A
setLanguage($language) { $this->languages[] = $language; }
-
B
function setLanguage() { $this->languages[] = $language; }
-
C
function setLanguage($language) { $this->languages = $language; }
-
D
function setLanguage($language) { $this->languages[] = $language; }
-
E
function setLanguage($language) { $this->languages = array($language); }