1
I am developing a web system in PHP with MVC and Smarty. But I am having the following problem. My system when entering an Exception it automatically opens a call already with the error (inserts a value in a table responsible for the call). The problem starts there, build error does not enter any Exception. For example:
<?php
$a = 1;
a
echo $a;
?>
Note that there is a loose letter there, I get the following message:
Parse error: syntax error, unexpected 'echo' (T_ECHO) in...
I already use these two functions to catch PHP errors:
set_exception_handler('myException');
set_error_handler('myHandler',E_ALL);
I have already implemented classes that inherit the class Exception
to handle errors. Nothing else to solve this problem.
See if that answer helping.
– Papa Charlie
For reference (English) http://stackoverflow.com/q/13378959/194717
– Tony
Thank you very much Papa Chalie, helped me a lot, that’s just what I needed.
– Pedro Soares
@Pedrosoares, some errors cannot be captured by
set_error_handler
, therefore the use ofshutdown
to capture what 'remains'. Take a look at this reference.– Papa Charlie