Exception handling in PHP is as same as java.so when an error occurs we can throw an exception using try method then it creates an exception object. An exception can be caught using catch method somewhere in the code where we can decide what to do with the particular error and that error can be used to read details about the error.
Exception handling in PHP is as same as java.so when an error occurs we can throw an exception using try method then it creates an exception object. An exception can be caught using catch method somewhere in the code where we can decide what to do with the particular error and that error can be used to read details about the error.