Back To Lesson

Quiz: Advanced PHP & Database Integration (MySQL)

Quiz Instructions:

  • Each question is followed by multiple-choice answers (A, B, C, D, and sometimes E).
  • Carefully read each question and all answer options before selecting the best answer.
  • Choose the option that most accurately aligns with the key concepts or information provided.

Question 1: Which of the following best describes encapsulation?

Question 2: What is a class in PHP?

Question 3: Which OOP principle allows a class to inherit methods and properties from another class?

Question 4: What does the $this keyword refer to in PHP?

Question 5: Which keyword is used to inherit a class in PHP?

Question 6: What is polymorphism in OOP?

Question 7: Which access modifier makes a property or method accessible only within the class it is defined in?

Question 8: What does the interface keyword define in PHP?

Question 9: Why is inheritance useful in PHP OOP?

Question 10: What is the role of a constructor in a PHP class?

Question 11: What is the purpose of the final keyword in PHP OOP?

Question 12: Which keyword is used to prevent a class from being instantiated directly?

Question 13: Why is encapsulation important in OOP?