Differentiate between exception and error
Differentiate between exception and error
In PHP, exceptions and errors are both mechanisms for handling unexpected or exceptional situations that occur during the execution of a script. However, they differ in their purpose, handling, and the types of situations they address.
Example:
try {
$result = 10 / 0; // Throws a DivisionByZeroError exception...
middle
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào