Exception handling is described in PHP try catch finally statement
Aug 26, 2020
PHP
Beginner
For Beginners
PHP7
PHP7.4
Purpose
- The method of checking exception handling is summarized below
Implementation environment
- Check the operation on the following site -https://paiza.io/ja
#Example
-
Below is an example of how to write a try catch finally statement for exception handling.
try { // Processing that may cause an exception } catch (Exception class name Variable name that receives the return value of exception class) { //Process that is executed when "Process that may cause exception" is an exception } finally { //Process executed regardless of exception }