menu

PHP OOPs Concepts


1. Which OOPs concept is used to create objects from abstract classes and interfaces?

Abstraction

Encapsulation

Polymorphism

Inheritance


2. Which keyword is used to declare a class in PHP?

object

new

class

this


3. Which keyword is used to access a property or method of a class within the class itself?

this

$this

parent

static


4. Which keyword is used to prevent a class from being inherited by other classes in PHP?

$final

final

abstract

private


5. Which OOPs concept is used to restrict access to properties and methods of a class?

Encapsulation

Inheritance

Polymorphism

Abstraction


6. What is the full form of OOP in PHP?

Object Oriented Programming

Online Order Processing

Operating Oriented Programming

Object Oriented Python


7. Which OOPs concept allows a class to have multiple methods with the same name but different parameters?

Overloading

Polymorphism

Inheritance

Encapsulation


8. Which OOPs concept allows objects of different classes to be treated as if they were objects of the same class?

Polymorphism

Inheritance

Encapsulation

Abstraction


9. Which OOPs concept allows one class to inherit properties and methods from another class?

Inheritance

Encapsulation

Polymorphism

Abstraction


10. Which keyword is used to refer to the current class in PHP?

$self

$this

self

parent