
Object-Oriented Programming Quiz
Quiz
•
Information Technology (IT)
•
Professional Development
•
Practice Problem
•
Medium
Cecilio Salonoy
Used 2+ times
FREE Resource
Enhance your content in a minute
40 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the primary purpose of exceptions in PHP?
To improve performance
To handle errors and exceptional conditions
To create faster loops
To replace variables
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which PHP keyword is used to define a block of code where exceptions may occur?
throw
catch
try
finally
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which keyword is used to raise an exception in PHP?
raise
throw
error
catch
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
In the given example, what is the name of the custom exception class?
MyException
CustomException
UserException
DivisionException
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What block of code is executed regardless of whether an exception is thrown or not?
try
throw
catch
finally
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Given the function: function divide($a, $b) { if ($b === 0) { throw new Exception("Division by zero."); } return $a / $b; } What happens when divide(4, 0) is called?
Returns 0
Throws an Exception
Prints "Division by zero."
Ignores the error
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
If an exception is thrown but no catch block is defined, what will happen?
The program ignores the exception
The program continues as normal
The program terminates with a fatal error
The program retries the block
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
35 questions
CCSA-4
Quiz
•
Professional Development
38 questions
CompTIA Tech+ Review - 10.21.2025
Quiz
•
Professional Development
40 questions
Subnetting Quiz
Quiz
•
Professional Development
45 questions
KSS QUIZ
Quiz
•
Professional Development
40 questions
PHP Functions Quiz
Quiz
•
Professional Development
45 questions
CCST - Networking
Quiz
•
Professional Development
39 questions
Quiz of anything
Quiz
•
Professional Development
40 questions
Cryptography Quiz
Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
