Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

MCQ

PHP Questions and Answers – Exception Handling

This collection of PHP Multiple Choice Questions and Answers (MCQs): Quizzes & Practice Tests with Answer focuses on “Exception Handling”.
 

1. Which PHP version provide Exception handling?

A PHP 6

B PHP 5.3

C PHP 5

D PHP 4

 

2. In PHP there are ____ error levels.

A 17

B 16

C 15

D 14

 

3. What is the intent of try block?

A It introduce block of code in which exception can arise.

B It is used instead of catch block or after catch block.

C It is used to throw an exception.

D None of the above

 

4. What is the intent of finally block?

A It introduce block of code in which exception can arise.

B It is used instead of catch block or after catch block.

C It is used to throw an exception.

D None of the above

 

5. What is the intent of throw block?

A It introduce block of code in which exception can arise.

B It is used instead of catch block or after catch block.

C It is used to throw an exception.

D None of the above

 

6. Which of the following declaration invoke the exception class?

A

throws new Exception();
throws new Exception();

B

throw new Exception();
throw new Exception();

C

new Exception();
new Exception();

D

new throws Exception();
new throws Exception();

 

7. Why using Exception Handling in PHP?

A To separate the error handling code from normal code

B Grouping of error types

C Both A And B

D None of the above

 

8. Which is not a specific keywords in exception handling?

A this

B try

C catch

D throw

 

9. What is the explanation of Error level E_ERROR?

A Fatal Compile-time error

B Fatal run-time error

C Compile-time error

D Near-fatal error

 

10. Which of the following are an exception in PHP?

A UnderflowException

B OverflowException

C OutOfRangeException

D OutOfBoundException

MCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *