Exceptions And Error Handling MCQs with Explanations
Practice high-yield Programming & Software Development MCQs on Exceptions And Error Handling with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.
Questions
20
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
24 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
20
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress | 0/20 answered
✓ 0 correct
✗ 0 wrong
0% score
🎉 Set complete! All 20 questions answered.
Question 1 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Question 2 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which character do the error_reporting directive use to represent the logical operator NOT?
Question 3 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which version introduced the function error_get_last()?
Question 4 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which function initializes the constants necessary for using the openlog(), clodelog(), and syslog() functions?
Question 5 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which version of PHP was added with Exception handling?
Question 6 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How many methods are available for the exception class?
Question 7 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
You can extend the exception base class, but you cannot override any of the preceding methods because the are declared as__________
Question 8 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does SPL stand for?
Question 9 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How many error levels are available in PHP?
Question 10 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the description of Error level E_ERROR?
Question 11 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Say you want to report error concerned about fatal run-time, fatal compile-time error and core error which statement would you use?
Question 12 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following statements causes PHP to disregard repeated error messages that occur within the same file and on the same line?
Question 13 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which logging option’s description is, if an error occurs when writing to the syslog, send output to the system console?
Question 14 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which function is responsible for sending a custom message to the system log?
Question 15 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which version added the method getPrevious()?
Question 16 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following statements invoke the exception class?
Question 17 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which one of the following is the right description for the method getMessage() ?
Question 18 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How many predefined exceptions does SPL provide access to?
Question 19 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is/are not an exception? 1. BadFunctionCallException 2. BadMethodCallException 3. LogicException 4. DomainException
Question 20 of 20
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is/are an exception? 1. OutOfBoundException 2. OutOfRangeException 3. OverflowException 4. UnderflowException
✓ Link copied to clipboard
Continue Your Practice
Next Practice Set → Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡 Examiner's Advisory for Programming & Software Development
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.