@ should be avoided where possible for a host of reasons see here for lots of details:
http://derickrethans.nl/five-reasons-why-the-shutop-operator-should-be-a...
In filter_dom_load() we use @ when calling DOMDocument::loadHTML() This was added in
#653940: Clean-up: Tests do not report all errors
http://drupalcode.org/viewvc/drupal/drupal/modules/filter/filter.module?...
Apparently to cleanup test exceptions? Though there doesn't seem to be a clear explanation.
In cases where there are several pieces of text on a page that use an HTML format, having the @ will negatively impact performance. It is also masking a strict error
Strict warning: Non-static method DOMDocument::loadHTML() should not be called statically in filter_dom_load()
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 951774-domdocument-loadhtml-static.patch | 2.47 KB | damien tournoud |
Comments
Comment #1
damien tournoud commentedWoo. Big PHP WTF here again. Fun.
The @ operator is here to stay. We precisely want to ignore errors triggered by loading the HTML. But we should fix the static call.
Comment #2
damien tournoud commentedThere is no way to tell DOM not to issue those errors, so there is no possible performance improvement here.
Comment #3
damien tournoud commentedLet's fix those static calls.
Comment #4
sunThanks!
Comment #5
dries commentedGood catch. Committed to CVS HEAD. Thanks.