@ 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()

Comments

damien tournoud’s picture

Title: @ should be avoided in filter_dom_load() because it hides errors and causes performance issues. » DOMDocument::loadHTML() should not be called statically

Woo. 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.

damien tournoud’s picture

Issue tags: -Performance, -error reporting

There is no way to tell DOM not to issue those errors, so there is no possible performance improvement here.

damien tournoud’s picture

Status: Active » Needs review
StatusFileSize
new2.47 KB

Let's fix those static calls.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

dries’s picture

Status: Reviewed & tested by the community » Fixed

Good catch. Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.