Publisher review:Converting old PHP Errors into Exceptions - define a function to handle errors. The PHP5 Exception class will not work correctly. It would reflect an incorrect line number and file name and not record the 'errcontext' value associated with PHP errors. To solve this problem, we must extend the Exception class.
We need to define a function to handle errors. We also want to write two helper functions that will set and restore the error handler to our function. To do this, we write three methods in an abstract class.
To test it, we create a file that triggers errors. Before triggering the first error, we call Initialize(). We then Uninitialize() the error handler and trigger the error again to check that our error handler has been removed. It is important to check the line numbers mentioned in the message that this prints!
Converting old PHP Errors into Exceptions is a PHP script for Snippets scripts design by Charlie.
It runs on following operating system: Windows / Linux.
Converting old PHP Errors into Exceptions - define a function to handle errors.
Operating system:Windows / Linux