<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
				<title>Comments on: Catching Warnings and Notices</title>
		<link>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html</link>
		<description>Catching Warnings and Notices Comment Feed</description>
				<language>de</language>
		<pubDate>Sun, 05 Feb 2012 09:16:26 +0000</pubDate>
		<generator>mcw[blog] 'Ruby' Alpha 3</generator>
		<item>
			<title>Comment #1 by: Loïc Hoguin</title>
			<link>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment20</link>
			<guid>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment20</guid>
			<author>Loïc Hoguin</author>			
			<pubDate>Sat, 13 Dec 2008 09:52:48 +0000</pubDate>
			<content:encoded><![CDATA[ Hello, that's a good technique indeed.<br />
<br />
Note however that your handler currently also throw exceptions when errors are silenced with the @ operator. In order to continue the script correctly when an error has been silenced, you need to add the following at the start of your handler: "if (error_reporting() == 0) return;". (see php.net/set_error_handler)<br />
<br />
Even if it shouldn't happen often, sometimes you simply need to silence warnings and continue the script anyway. ]]></content:encoded>
		</item>
		<item>
			<title>Comment #2 by: Dominik Jungowski </title>
			<link>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment21</link>
			<guid>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment21</guid>
			<author>Dominik Jungowski </author>			
			<pubDate>Sat, 13 Dec 2008 13:14:48 +0000</pubDate>
			<content:encoded><![CDATA[ I can understand your point indeed,the question would be though: why suppress it with @ (and slowing things down),when i can just put the call in a try-catch-block ;) ]]></content:encoded>
		</item>
		<item>
			<title>Comment #3 by: Jagger Wang</title>
			<link>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment22</link>
			<guid>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment22</guid>
			<author>Jagger Wang</author>			
			<pubDate>Sat, 13 Dec 2008 15:38:13 +0000</pubDate>
			<content:encoded><![CDATA[ Good skill! ]]></content:encoded>
		</item>
		<item>
			<title>Comment #4 by: Loïc Hoguin</title>
			<link>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment23</link>
			<guid>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment23</guid>
			<author>Loïc Hoguin</author>			
			<pubDate>Sat, 13 Dec 2008 20:33:24 +0000</pubDate>
			<content:encoded><![CDATA[ @Dominik<br />
<br />
When working with third party code you cannot ensure that this code will avoid using @, and not filtering the silenced errors will thus break it. The errors needs to be silenced and no exception be thrown for the third party code to work correctly.<br />
<br />
That's the most common example I've met, like when using PEAR with PHP5 and E_STRICT enabled.<br />
<br />
You might also consider using the ErrorException class instead of the Exception class.<br />
 ]]></content:encoded>
		</item>
		<item>
			<title>Comment #5 by: Dominik Jungowski </title>
			<link>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment24</link>
			<guid>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment24</guid>
			<author>Dominik Jungowski </author>			
			<pubDate>Sun, 14 Dec 2008 00:17:44 +0000</pubDate>
			<content:encoded><![CDATA[ Didn't think of that. In that case it surely makes sense ]]></content:encoded>
		</item>
		<item>
			<title>Comment #6 by: fusero</title>
			<link>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment3253</link>
			<guid>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment3253</guid>
			<author>fusero</author>			
			<pubDate>Mon, 27 Jul 2009 08:22:41 +0000</pubDate>
			<content:encoded><![CDATA[ i've seen that this method is quite popular in order to be able to manage PHP warnigns and notices&#8230; but i wonder (as a newbie in php eceptions) if there is a way to custom the exception to be thrown in the static method handle(). For example, i would like to be able to throw an IOException when a file cannot be open, or a MathException when i find a division by zero. Can i do this wothout having to search for key words in error message? ]]></content:encoded>
		</item>
		<item>
			<title>Comment #7 by: Dirk Pahl</title>
			<link>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment15202</link>
			<guid>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment15202</guid>
			<author>Dirk Pahl</author>			
			<pubDate>Thu, 17 Jun 2010 14:25:44 +0000</pubDate>
			<content:encoded><![CDATA[ Hello,<br />
<br />
found this post when looking for a method to deal with PHP notices and warnings and wondered about the sentence "Using @ before a function call is really, really bad coding and it makes your code slow.". So I wrote a little benchmark script:<br />
<br />
$start = microtime(true);<br />
for($i = 0; $i < 10000; $i++) {<br />
    @unserialize("unserializable");<br />
}<br />
$duration = microtime(true) - $start;<br />
print("overall duration with @: $duration\n");<br />
<br />
$start = microtime(true);<br />
for($i = 0; $i < 10000; $i++) {<br />
    ErrorHandler::set();<br />
    try {<br />
        unserialize("unserializable");<br />
    }<br />
    catch(Exception $e) {}<br />
    ErrorHandler::reset();<br />
}<br />
$duration = microtime(true) - $start;<br />
print("overall duration with error handler: $duration\n");<br />
<br />
The function ErrorHandler::reset() is a call of restore_error_handler() as I want to go on with the initially configured error reporting settings after handling this notice.<br />
<br />
The result of this little benchmark is completely different from what is said in the mentioned sentence above:<br />
<br />
overall duration with @: 0.0735211372375<br />
overall duration with error handler: 0.959964036942<br />
<br />
Using the @ is more than ten times faster on my machine. ]]></content:encoded>
		</item>
		<item>
			<title>Comment #8 by: Dominik Jungowski</title>
			<link>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment15211</link>
			<guid>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment15211</guid>
			<author>Dominik Jungowski</author>			
			<pubDate>Fri, 18 Jun 2010 07:00:16 +0000</pubDate>
			<content:encoded><![CDATA[ Did the script without @ write an error message? If so, it should be the reason why it's so much slower. ]]></content:encoded>
		</item>
		<item>
			<title>Comment #9 by: Dirk Pahl</title>
			<link>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment15212</link>
			<guid>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment15212</guid>
			<author>Dirk Pahl</author>			
			<pubDate>Fri, 18 Jun 2010 07:49:18 +0000</pubDate>
			<content:encoded><![CDATA[ No, it did'nt write an error message because I caught the exception &#8230; The two lines shown are the only output ]]></content:encoded>
		</item>
		<item>
			<title>Comment #10 by: Dominik Jungowski</title>
			<link>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment15213</link>
			<guid>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment15213</guid>
			<author>Dominik Jungowski</author>			
			<pubDate>Fri, 18 Jun 2010 09:31:25 +0000</pubDate>
			<content:encoded><![CDATA[ Then I would guess it's the try catch that makes it slow. It would be interesting to see what the script is like without the try-catch and without any output. ]]></content:encoded>
		</item>
		<item>
			<title>Comment #11 by: Dirk Pahl</title>
			<link>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment15214</link>
			<guid>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment15214</guid>
			<author>Dirk Pahl</author>			
			<pubDate>Fri, 18 Jun 2010 09:42:45 +0000</pubDate>
			<content:encoded><![CDATA[ I removed throwing exceptions and catching them. After that the output is:<br />
<br />
overall duration with @: 0.0508148670197<br />
overall duration with error handler: 0.194847106934<br />
<br />
First version is still 4 times faster. I think it's because setting and resetting the error handler in each loop. But even when I set end reset the error handler only one time before and after the loop I get:<br />
<br />
overall duration with @: 0.051607131958<br />
overall duration with error handler: 0.0809028148651<br />
<br />
Both versions need nearly the same time now but using @ is still a bit faster. ]]></content:encoded>
		</item>
		<item>
			<title>Comment #12 by: Dominik Jungowski</title>
			<link>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment15216</link>
			<guid>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment15216</guid>
			<author>Dominik Jungowski</author>			
			<pubDate>Fri, 18 Jun 2010 10:24:01 +0000</pubDate>
			<content:encoded><![CDATA[ Which is strange, since @ modifies the error handling before and after each (function) call.<br />
<br />
Are both benchmarks in one file or is it one file per benchmark? ]]></content:encoded>
		</item>
		<item>
			<title>Comment #13 by: Dirk Pahl</title>
			<link>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment15224</link>
			<guid>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment15224</guid>
			<author>Dirk Pahl</author>			
			<pubDate>Fri, 18 Jun 2010 17:56:59 +0000</pubDate>
			<content:encoded><![CDATA[ Are both in the same file. When running in different files you get the same results. It seems to me that setting the error handler is even more expensive than what is done when using @. ]]></content:encoded>
		</item>
		<item>
			<title>Comment #14 by: Gecetauctiora</title>
			<link>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment58883</link>
			<guid>http://www.phpdevblog.net/2008/11/catching-warnings-and-notices.html#comment58883</guid>
			<author>Gecetauctiora</author>			
			<pubDate>Mon, 28 Nov 2011 01:38:24 +0000</pubDate>
			<content:encoded><![CDATA[   <br />
Good Ol Boys Moving have gained a helpful popularity as an in a position packer in addition to moving company, on meeting both another country and local relocating digs up. Lots of people have previously put into use the requirements which is available from <a href="http://wiki.citizen.apps.gov/nrcsmallbusiness/index.php/Good_Ol_Boys_Moving">Good ol boys moving</a> and found each of them worth his or her's claims. The company creates the option for with also policy in an effort to estimation ones moving about criteria ahead of time. The agency carries with it an comprehensive online circle for changers distribute via Nova scotia, simply put nearby progressing must have are became aquainted with at once. This agency has the benefit of incredibly professional solution around rapid point in time to ensure you really do not shed precious mobility effort during extraneous hold-up. Problems, attractive various other competitiveness, you must think about communicating with Good Ol Boys Moving.   <br />
good ol boys Moving stands out as the filling plus moving company to contemplate, you need to understand toward shorten any moving forward prerequisites. Good Ol Boys Moving makes certain that the necessary moving specifications are attained with stated wasted time you do not have to get anxious these days to the quality of the service distributed. Automobile called this manufacturer, make no mistake that your switching needs to have are increasingly cured from the greatest masters at the subject. You need to positively think about using the very 100 percent free quotations formula service of your organisation to actually estimation your personal changing prerequisites before you start. Aside from the great complimentary premiums system, there's also the power to obtain from the internet arranging on the move, so that you can chose the full workouts with travelling things to consider. All you have to accomplish is to always investigate freely available price quotes car loans calculator, review all your moving wishes as well as complete press announcements variety to learn from your products for good ol boys moving.       <br />
  <br />
You will find many professional movers, when you're desiring to continue in one destination to one more, and you could discover that Good ol boys moving affords the very best system regardless of whether you're relocation locally as well as throughout the world. That good ol boys Moving has been doing this excellent brand cardio and it's definitely trustworthy as well as good. If you feel that Good Ol Boys Moving really are costly, then simply to your own astound, you will find that are particularly reasonably priced  <br />
That Good ol boys moving communicates the switch for everyone a simpler a single. It helps to have competent communicating while using the Good ol boys Moving office workers as it can show up the problem related to initiative connected with issues, that may add additional set you back inside your charges. A person have to be absolutely clear on their part regarding how what he or she have need to occur, as well moving company office workers will guarantee this not any kinda error in judgment is fully committed out of their component, may possibly give you discontent with the clientele. This unique Good ol boys moving organizations has been in the industry for decades and possess always been allowing terrific want to the nation's shoppers repeatedly.  <br />
  <br />
 ]]></content:encoded>
		</item>
		</channel>
</rss>
