note 102543 added to language.operators.errorcontrol
[email protected] Sun, 20 Feb 2011 12:39:10 -0800
| Newsgroups | php.notes |
|---|---|
| Message-ID | <[email protected]> |
If you're wondering what the performance impact of using the @ operator is, consider this example. Here, the second script (using the @ operator) takes 1.75x as long to execute...almost double the time of the first script.
So while yes, there is some overhead, per iteration, we see that the @ operator added only .005 ms per call. Not reason enough, imho, to avoid using the @ operator.
<?php
function x() { }
for ($i = 0; $i < 1000000; $i++) { x(); }
real 0m7.617s
user 0m6.788s
sys 0m0.792s
vs
<?php
function x() { }
for ($i = 0; $i < 1000000; $i++) { @x(); }
real 0m13.333s
user 0m12.437s
sys 0m0.836s
----
Server IP: 72.55.140.6
Probable Submitter: 216.99.60.219
----
Manual Page -- http://www.php.net/manual/en/language.operators.errorcontrol.php
Edit -- https://master.php.net/note/edit/102543
Del: integrated -- https://master.php.net/note/delete/102543/integrated
Del: useless -- https://master.php.net/note/delete/102543/useless
Del: bad code -- https://master.php.net/note/delete/102543/bad+code
Del: spam -- https://master.php.net/note/delete/102543/spam
Del: non-english -- https://master.php.net/note/delete/102543/non-english
Del: in docs -- https://master.php.net/note/delete/102543/in+docs
Del: other reasons-- https://master.php.net/note/delete/102543
Reject -- https://master.php.net/note/reject/102543
Search -- https://master.php.net/manage/user-notes.php