21 OOP questions from the PHP bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.
Free to start: the 2-minute IT readiness check — six questions and a result.
A.a reference that resolves to the exact class in which a method is written at compile time, ignoring which subclass actually invoked it
B.a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
C.a class that cannot be instantiated on its own and may declare methods without bodies that subclasses are required to implement
D.a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
Answer + AI explanation with Pro
2. Which term means: "a class that cannot be instantiated on its own and may declare methods without bodies that subclasses are required to implement"?
Junior
A.Interface
B.Late static binding
C.Visibility modifier
D.Abstract class
Answer + AI explanation with Pro
3. Which statement is correct?
Junior
A.Abstract class — the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
B.Abstract class — a fully abstract contract listing public method signatures and constants that any implementing class must fulfil, with no implementation of its own
C.Abstract class — a class that cannot be instantiated on its own and may declare methods without bodies that subclasses are required to implement
D.Abstract class — a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
Answer + AI explanation with Pro
4. What is Interface?
Junior
A.a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
B.a fully abstract contract listing public method signatures and constants that any implementing class must fulfil, with no implementation of its own
C.a reference that resolves to the exact class in which a method is written at compile time, ignoring which subclass actually invoked it
D.a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
Answer + AI explanation with Pro
5. Which term means: "a fully abstract contract listing public method signatures and constants that any implementing class must fulfil, with no implementation of its own"?
Junior
A.Visibility modifier
B.Interface
C.Readonly property
D.self keyword
Answer + AI explanation with Pro
6. Which statement is correct?
Junior
A.Interface — a fully abstract contract listing public method signatures and constants that any implementing class must fulfil, with no implementation of its own
B.Interface — a reference that resolves to the exact class in which a method is written at compile time, ignoring which subclass actually invoked it
C.Interface — a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
D.Interface — a reusable block of methods and properties that is composed into a class with the use keyword to share behaviour horizontally without inheritance
Answer + AI explanation with Pro
7. What is Trait?
Mid
A.the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
B.a fully abstract contract listing public method signatures and constants that any implementing class must fulfil, with no implementation of its own
C.a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
D.a reusable block of methods and properties that is composed into a class with the use keyword to share behaviour horizontally without inheritance
Answer + AI explanation with Pro
8. Which term means: "a reusable block of methods and properties that is composed into a class with the use keyword to share behaviour horizontally without inheritance"?
Mid
A.Interface
B.self keyword
C.Abstract class
D.Trait
Answer + AI explanation with Pro
9. Which statement is correct?
Mid
A.Trait — a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
B.Trait — a reusable block of methods and properties that is composed into a class with the use keyword to share behaviour horizontally without inheritance
C.Trait — the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
D.Trait — a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
Answer + AI explanation with Pro
10. What is Visibility modifier?
Mid
A.a class that cannot be instantiated on its own and may declare methods without bodies that subclasses are required to implement
B.a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
C.the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
D.a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
Answer + AI explanation with Pro
11. Which term means: "a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class"?
Mid
A.Late static binding
B.Trait
C.self keyword
D.Visibility modifier
Answer + AI explanation with Pro
12. Which statement is correct?
Mid
A.Visibility modifier — the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
B.Visibility modifier — a class that cannot be instantiated on its own and may declare methods without bodies that subclasses are required to implement
C.Visibility modifier — a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
D.Visibility modifier — a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
Answer + AI explanation with Pro
13. What is Late static binding?
Senior
A.the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
B.a class that cannot be instantiated on its own and may declare methods without bodies that subclasses are required to implement
C.a fully abstract contract listing public method signatures and constants that any implementing class must fulfil, with no implementation of its own
D.a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
Answer + AI explanation with Pro
14. Which term means: "the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on"?
Senior
A.Late static binding
B.Interface
C.Trait
D.Readonly property
Answer + AI explanation with Pro
15. Which statement is correct?
Senior
A.Late static binding — a fully abstract contract listing public method signatures and constants that any implementing class must fulfil, with no implementation of its own
B.Late static binding — a class that cannot be instantiated on its own and may declare methods without bodies that subclasses are required to implement
C.Late static binding — the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
D.Late static binding — a reusable block of methods and properties that is composed into a class with the use keyword to share behaviour horizontally without inheritance
Answer + AI explanation with Pro
16. What is self keyword?
Senior
A.a reference that resolves to the exact class in which a method is written at compile time, ignoring which subclass actually invoked it
B.a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
C.a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
D.a class that cannot be instantiated on its own and may declare methods without bodies that subclasses are required to implement
Answer + AI explanation with Pro
17. Which term means: "a reference that resolves to the exact class in which a method is written at compile time, ignoring which subclass actually invoked it"?
Senior
A.Interface
B.Visibility modifier
C.self keyword
D.Abstract class
Answer + AI explanation with Pro
18. Which statement is correct?
Senior
A.self keyword — a reference that resolves to the exact class in which a method is written at compile time, ignoring which subclass actually invoked it
B.self keyword — a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
C.self keyword — a reusable block of methods and properties that is composed into a class with the use keyword to share behaviour horizontally without inheritance
D.self keyword — the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
Answer + AI explanation with Pro
19. What is Readonly property?
Mid
A.a reusable block of methods and properties that is composed into a class with the use keyword to share behaviour horizontally without inheritance
B.a keyword such as public, protected, or private that controls whether a class member can be accessed from outside, only within the hierarchy, or only inside the declaring class
C.the mechanism, accessed through the static keyword, that resolves a called class at runtime so a parent method can reference the actual subclass it was invoked on
D.a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
Answer + AI explanation with Pro
20. Which term means: "a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed"?
Mid
A.self keyword
B.Readonly property
C.Trait
D.Late static binding
Answer + AI explanation with Pro
21. Which statement is correct?
Mid
A.Readonly property — a reusable block of methods and properties that is composed into a class with the use keyword to share behaviour horizontally without inheritance
B.Readonly property — a fully abstract contract listing public method signatures and constants that any implementing class must fulfil, with no implementation of its own
C.Readonly property — a reference that resolves to the exact class in which a method is written at compile time, ignoring which subclass actually invoked it
D.Readonly property — a typed instance member, introduced in PHP 8.1, that may be assigned exactly once from within the declaring class scope and then cannot be changed
Answer + AI explanation with Pro
Free to start
Start with a free readiness check
Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every OOP question come with Pro.