Re: Re: Should PEAR code emit notices/warnings?
| From: | Christian Schmidt | Date: | Wed, 12 Mar 2008 08:28:21 +0000 |
| Subject: | Re: Re: Should PEAR code emit notices/warnings? | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-49392@lists.php.net to get a copy of this message | ||
Michael Gauthier wrote:
Till has a point about error suppression though. I've run into a problem in PEAR before where error suppression was used on a conditional include. The returned PEAR_Error object had a message about the driver class not being found. It took me forever to determine that the driver was being found and just had a parse error.I had a similar problem the other day. May script just died without any explanation. It took me a while to figure out that it died deep inside DB_mysql::fetchInto() in DB/mysql.php because of an out of memory error in @mysql_fetch_array(). In cases like this it would be nice if there were a replacement for @ that silenced E_WARNINGs and E_NOTICEs but not fatal errors, i.e. a shortcut for "$old = error_reporting(E_ERROR); foo(); error_reporting($old)". Or perhaps there is another way of handling fatal errors under these circumstances? Fatal errors really are a pain. Christian