Home > PHP & Programming > Quizzes > Web Development Practice Test: OOP (Object-Oriented Programming) Using PHP
Web Development Practice Test: OOP (Object-Oriented Programming) Using PHP
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 62% Most missed: “-----the property or method can be accessed from everywhere. This is default”

Object-oriented programming is a programming model organized around Object rather than the actions and data rather than logic.

Abstraction, encapsulation, inheritance, and polymorphism are four of the main principles of object-oriented programming.

Web Development Practice Test: OOP (Object-Oriented Programming) Using PHP
Time left 00:00
25 Questions

1. The----keyword can be used to prevent class inheritance or to prevent method overriding
2. -----of a class is created using the new keyword
3. The-----pseudo-type was introduced in PHP 7.1, and it can be used as a data type for function arguments and function return values.
4. The-----keyword refers to the current object, and is only available inside methods
5. The-----will inherit all the public and protected properties and methods from the parent class. In addition, it can have its own properties and methods.
6. Interfaces are declared with the------keyword.
7. Notice that the destruct function starts with-------
8. --------in OOP When a class derives from another class.
9. We can access a-------from outside the class by using the class name followed by the scope resolution operator (::) followed by the constant name
10. A------ is called when the object is destructed or the script is stopped or exited.
11. ------stands for Object-Oriented Programming.
12. -------classes and methods are when the parent class has a named method, but need its child class(es) to fill out the tasks
13. A class is defined by using the---keyword, followed by the name of the class and a pair of curly braces ({}). All its properties and methods go inside the braces
14. If you create a-----function, PHP will automatically call this function when you create an object from a class.
15. -----the property or method can be accessed from everywhere. This is default
16. An------method is a method that is declared, but not implemented in the code.
17. The-----class method must be defined with the same or a less restricted access modifier
18. You can use the----keyword to check if an object belongs to a specific class
19. An inherited class is defined by using the------keyword
20. that the construct function starts with two underscores-------
21. PHP only supports---------a child class can inherit only from one single parent.
22. An iterable is any value which can be looped through with a-----loop.
23. A-----allows you to initialize an object's properties upon creation of the object
24. The-----keyword can be used as a data type of a function argument or as the return type of a function:
25. ------properties can be called directly - without creating an instance of a class.