Home > PHP & Programming > Quizzes > Practice Test: Classes And Objects In PHP
Practice Test: Classes And Objects In PHP
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 50% Most missed: “… is utilized in reading data from inaccessible or non-existing properties.”
Practice Test: Classes And Objects In PHP
Time left 00:00
19 Questions

1. The property …. must be an instance of the same class in which the property is defined.
2. Inside the class definition …. refers to the current object.
3. The functions within the class are also called …
4. Within the class methods, static properties will be accessed using …
5. Which of the following statements about the OOP constructors are TRUE or FALSE.
i) Constructors can call class methods or other functions.
ii) Class constructors can call on other constructors.
iii) Constructors can accept parameters.
6. Making a property as … prevents it from being overridden by a subclass.
7. State whether the following statements about the constructors are TRUE.
i) Parent constructors are called implicitly if the child class defines a constructor.
ii) In order to run a parent constructor, a call to parent::_construct() within the child constructor is required.
8. The instanceof keyword was introduced with …
9. … is utilized in reading data from inaccessible or non-existing properties.
10. State whether the following statements about the OOP constructors are TRUE or FALSE.
i) PHP also offered class constructors.
ii) PHP automatically calls the parent constructor.
iii) PHP recognizes constructors by the name _construct.
11. State whether the following statements are TRUE or FALSE.
i) Class properties and methods live in separate namespaces.
ii) It is possible to have a property and a method with the same name.
iii) Calling an anonymous function that has been assigned to a property is directly possible.
12. You can’t use … within a class to refer to a property declared as static.
13. The … allows for fully qualified class name resolution at compile time, this is useful for namespaced classes.
14. … properties can be accessed and manipulated directly via the corresponding object.
15. The destructor will be called even if script execution is stopped using …
16. … properties are only accessible from within the class in which they are defined.
17. … is run when writing data to inaccessible or non-existing properties.
18. Within the class methods, non-static properties will be accessed using …
19. A class may contain its own constants and variables are called …