Re: [patch] error masks
| From: | Stanislav Malyshev | Date: | Tue, 25 Aug 2009 06:43:22 +0000 |
| Subject: | Re: [patch] error masks | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-45385@lists.php.net to get a copy of this message | ||
Hi!
@ is often used to stop error/warning output to the browser on that line, but the next couple lines of code are used to handle that error. For example:
if (!($dom = @DOMDocument::load($file_name))) {
log_it('invalid XML: ' . $php_errormsg);
die('invalid XML');
}
So if error processing is totally turned off, $php_errormsg won't be populated.
That's true. So, if you use code that uses $php_errormsg, of course you can not use this optimization and should not enable it (at least for error types and code parts that you use $php_errormsg with).
Also, if you use @ to stop warning output to the browser you should read the manual about display_errors and part of the security guidelines when it says never enable display_errors in production ;)
--
Stanislav Malyshev, Zend Software Architect
stas@zend.com http://www.zend.com/
(408)253-8829 MSN: stas@zend.com