15 real Error Handling questions from the PHP bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.
1. What is Exception?
Junior
A.an object representing an anomalous condition that is thrown to interrupt normal flow and caught by a surrounding handler block
B.the base interface, implemented by both Error and Exception, that any object must satisfy to be usable with the throw statement
C.an optional clause after try and catch whose code always runs whether or not an exception was thrown, typically used for cleanup
D.passing a previous throwable as the third constructor argument so the original cause is preserved and retrievable while a new exception is raised
2. Which term means: "an object representing an anomalous condition that is thrown to interrupt normal flow and caught by a surrounding handler block"?
A.Exception — passing a previous throwable as the third constructor argument so the original cause is preserved and retrievable while a new exception is raised
B.Exception — an object representing an anomalous condition that is thrown to interrupt normal flow and caught by a surrounding handler block
C.Exception — an optional clause after try and catch whose code always runs whether or not an exception was thrown, typically used for cleanup
D.Exception — the hierarchy introduced in PHP 7 for internal engine problems such as type mismatches and calls to undefined functions, kept separate from user-level exceptions
A.the hierarchy introduced in PHP 7 for internal engine problems such as type mismatches and calls to undefined functions, kept separate from user-level exceptions
B.the base interface, implemented by both Error and Exception, that any object must satisfy to be usable with the throw statement
C.an optional clause after try and catch whose code always runs whether or not an exception was thrown, typically used for cleanup
D.an object representing an anomalous condition that is thrown to interrupt normal flow and caught by a surrounding handler block
5. Which term means: "an optional clause after try and catch whose code always runs whether or not an exception was thrown, typically used for cleanup"?
A.finally block — an object representing an anomalous condition that is thrown to interrupt normal flow and caught by a surrounding handler block
B.finally block — an optional clause after try and catch whose code always runs whether or not an exception was thrown, typically used for cleanup
C.finally block — the base interface, implemented by both Error and Exception, that any object must satisfy to be usable with the throw statement
D.finally block — the hierarchy introduced in PHP 7 for internal engine problems such as type mismatches and calls to undefined functions, kept separate from user-level exceptions
A.the base interface, implemented by both Error and Exception, that any object must satisfy to be usable with the throw statement
B.an object representing an anomalous condition that is thrown to interrupt normal flow and caught by a surrounding handler block
C.passing a previous throwable as the third constructor argument so the original cause is preserved and retrievable while a new exception is raised
D.the hierarchy introduced in PHP 7 for internal engine problems such as type mismatches and calls to undefined functions, kept separate from user-level exceptions
8. Which term means: "the base interface, implemented by both Error and Exception, that any object must satisfy to be usable with the throw statement"?
A.Throwable — the hierarchy introduced in PHP 7 for internal engine problems such as type mismatches and calls to undefined functions, kept separate from user-level exceptions
B.Throwable — an optional clause after try and catch whose code always runs whether or not an exception was thrown, typically used for cleanup
C.Throwable — passing a previous throwable as the third constructor argument so the original cause is preserved and retrievable while a new exception is raised
D.Throwable — the base interface, implemented by both Error and Exception, that any object must satisfy to be usable with the throw statement
A.an optional clause after try and catch whose code always runs whether or not an exception was thrown, typically used for cleanup
B.an object representing an anomalous condition that is thrown to interrupt normal flow and caught by a surrounding handler block
C.passing a previous throwable as the third constructor argument so the original cause is preserved and retrievable while a new exception is raised
D.the hierarchy introduced in PHP 7 for internal engine problems such as type mismatches and calls to undefined functions, kept separate from user-level exceptions
11. Which term means: "the hierarchy introduced in PHP 7 for internal engine problems such as type mismatches and calls to undefined functions, kept separate from user-level exceptions"?
A.Error class — an object representing an anomalous condition that is thrown to interrupt normal flow and caught by a surrounding handler block
B.Error class — the base interface, implemented by both Error and Exception, that any object must satisfy to be usable with the throw statement
C.Error class — passing a previous throwable as the third constructor argument so the original cause is preserved and retrievable while a new exception is raised
D.Error class — the hierarchy introduced in PHP 7 for internal engine problems such as type mismatches and calls to undefined functions, kept separate from user-level exceptions
A.the hierarchy introduced in PHP 7 for internal engine problems such as type mismatches and calls to undefined functions, kept separate from user-level exceptions
B.an object representing an anomalous condition that is thrown to interrupt normal flow and caught by a surrounding handler block
C.the base interface, implemented by both Error and Exception, that any object must satisfy to be usable with the throw statement
D.passing a previous throwable as the third constructor argument so the original cause is preserved and retrievable while a new exception is raised
14. Which term means: "passing a previous throwable as the third constructor argument so the original cause is preserved and retrievable while a new exception is raised"?
A.Exception chaining — an optional clause after try and catch whose code always runs whether or not an exception was thrown, typically used for cleanup
B.Exception chaining — passing a previous throwable as the third constructor argument so the original cause is preserved and retrievable while a new exception is raised
C.Exception chaining — an object representing an anomalous condition that is thrown to interrupt normal flow and caught by a surrounding handler block
D.Exception chaining — the base interface, implemented by both Error and Exception, that any object must satisfy to be usable with the throw statement
Answers, AI explanations, and a scored voice mock interview
Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.