Re: How can I detect an exception without using try/catch?
| From: | kranthi | Date: | Sun, 26 Apr 2009 06:06:15 +0000 |
| Subject: | Re: How can I detect an exception without using try/catch? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-291983@lists.php.net to get a copy of this message | ||
a POSSIBLE work round.
see if u can use
http://in2.php.net/manual/en/function.error-get-last.php
or
http://in2.php.net/manual/en/reserved.variables.phperrormsg.php
but
they are not working as expected with xdebug. use them in the
__destruct function to check for an uncaught exception
alternatively.. this approach is NOT RECOMMENDED. use it only if u run
out of options
keep the destructor empty. catch the exception and call a function to
perform destruction and then unset the object.
at the end of script, check if the object is set, call the function to
perform destruction. (php dosent destroy the object if the exception
is caught)
Kranthi.