What is exception in php?
Answers were Sorted based on User's Feedback
Answer / rishi (dipu lari)
PHP 5 has an exception model similar to that of other
programming languages. An exception can be thrown, and
caught ("catched") within PHP. Code may be surrounded in a
try block, to facilitate the catching of potential
exceptions. Each try must have at least one corresponding
catch block. Multiple catch blocks can be used to catch
different classes of exeptions. Normal execution (when no
exception is thrown within the try block, or when a catch
matching the thrown exception's class is not present) will
continue after that last catch block defined in sequence.
Exceptions can be thrown (or re-thrown) within a catch block.
| Is This Answer Correct ? | 13 Yes | 2 No |
Answer / guest
Exception handling is used to change the normal flow of the
code execution if a specified error (exceptional) condition
occurs. This condition is called an exception.
This is what normally happens when an exception is
triggered:
•The current code state is saved
•The code execution will switch to a predefined (custom)
exception handler function
•Depending on the situation, the handler may then resume
the execution from the saved code state, terminate the
script execution or continue the script from a different
location in the code
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain how can we execute a php script using command line?
How to take a substring from a given string in php?
How many functions are there in php?
How is a constant defined in a PHP script?
How do you destroy a session?
What is ci in php?
how many type of url?
Name some of the constants in php and their purpose.
What are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee(eno int(2),ename varchar(10)) ?
What is the purpose of the '.myd' file extension? What do thes file contain?
What is meant by urlencode and urldocode?
How to make multilanguage site in php? (like english,tamil)