Search Header Logo

PHP OOP Quiz I

Authored by Aymane Benhima

Information Technology (IT)

University

Used 1+ times

PHP OOP Quiz I
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does OOP stand for in PHP?

Object-Oriented Programming

Object-Option Programming

Operational Object Programming

Oriented Object Protocol

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to create a class in PHP?

class

new

object

create

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to instantiate an object in PHP?

$obj = new ClassName;

$obj = ClassName->new();

$obj = create ClassName;

$obj = ClassName::create();

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which symbol is used to access object properties and methods in PHP?

->

=>

.

::

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the $this keyword in PHP OOP?

Refers to the current object

Refers to the parent class

Creates a new instance

Refers to a static method

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare a public property in a PHP class?

public $propertyName;

var $propertyName;

$propertyName;

All of the above

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which visibility modifier restricts access to only the current class?

private

protected

public

internal

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?