Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.0

Request #16135 Suppressed errors get logged.
Submitted: 2009-04-22 02:20 UTC
From: garrettmoon Assigned: kvz
Status: Closed Package: System_Daemon (version 0.7.0)
PHP Version: 5.2.9 OS: OS X 10.5
Roadmaps: (Not assigned)    
Subscription  


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 4 + 10 = ?

 
 [2009-04-22 02:20 UTC] garrettmoon (Garrett Moon)
Description: ------------ If an statement is prepended with the suppression operator @ it is still logged by the daemon.

Comments

 [2009-04-22 02:49 UTC] kvz (Kevin van Zonneveld)
That's expected behavior because the error is always still fired. It's just silenced by PHP. But since System_Daemon catches errors, yeah they get logged. So is that a real bug? I think not. The use of isset(), empty(), coding with notices on And then logging errors, is more of an instrument against bugs in my humble opinion. If you have another view on that, there is one solution we could implement: http://nl.php.net/manual/en/function.set-error-handler.php#29315 But I think that would need to be optional in any case. What do you think?
 [2009-04-22 02:56 UTC] garrettmoon (Garrett Moon)
Well, I marked it as a feature/change request because I wasn't sure it was a bug either :) I agree that checking variables with isset and empty are good prevention methods, but some functions such as socket_accept generate warnings when the socket is busy and there is no way to check if the socket is busy. It sucks, but it's the way it is. If you have a server checking a socket for new connections in a loop and you want it non-blocking, you're going to get these warnings unless you suppress them. The patch I submitted simply returns from phpErrors if error_reporting() returns 0, which it will if the statement that caused the error was suppressed.
 [2009-04-25 15:20 UTC] kvz (Kevin van Zonneveld)
-Status: Open +Status: Closed -Assigned To: +Assigned To: kvz
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. I did not notice the patch, sorry for that. What you say in your reply makes sense to me. I've committed the patch and it will be in the next release. Thanks a lot!