menu

PHP OOPs Concepts


1. Which keyword is used to declare a method as static in PHP?

static

function

self

$this


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

Abstraction

Encapsulation

Polymorphism

Inheritance


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

$final

final

abstract

private


4. Which keyword is used to refer to the current instance of a class in PHP?

self

object

this

new


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

Encapsulation

Inheritance

Polymorphism

Abstraction


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

Polymorphism

Inheritance

Encapsulation

Abstraction


7. Which OOPs concept is used to define a blueprint for a class?

Abstraction

Inheritance

Encapsulation

Polymorphism


8. Which keyword is used to refer to the parent class of a class in PHP?

this

self

static

parent


9. Which keyword is used to create a new instance of a class in PHP?

this

class

object

new


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

$self

$this

self

parent