[wp-trac] [WordPress Trac] #9158: @ error-control operator overuse?
WordPress Trac
wp-trac at lists.automattic.com
Tue Feb 17 21:39:09 GMT 2009
#9158: @ error-control operator overuse?
--------------------------+-------------------------------------------------
Reporter: jidanni | Owner: anonymous
Type: defect (bug) | Status: new
Priority: lowest | Milestone:
Component: General | Version: 2.7
Severity: trivial | Keywords:
--------------------------+-------------------------------------------------
Curious to see what the many places where !WordPress uses the ''@
error-control operator''
(language.operators.errorcontrol.html)
might be hiding these days, I pasted ''Example 1 Error handling with
set_error_handler() and trigger_error()'' of
(function.set-error-handler.html
into wp-config.php, pointed my browser to wp-admin/index.php here
offline, and saw e.g.,
{{{
Assigning the return value of new by reference is deprecated
Creating default object from empty value
Non-static method WP_Http_Curl::test() should not be called statically,
assuming $this from incompatible context
Non-static method WP_Http_ExtHTTP::test() should not be called statically,
assuming $this from incompatible context
Non-static method WP_Http_Streams::test() should not be called statically,
assuming $this from incompatible context
Redefining already defined constructor for class WP_Dependencies
Redefining already defined constructor for class WP_Http
Redefining already defined constructor for class WP_Object_Cache
Redefining already defined constructor for class wpdb
Undefined property: stdClass::$updates
Undefined property: stdClass::$version_checked
is_a(): Deprecated. Please use the instanceof operator
mysql_fetch_object(): supplied argument is not a valid MySQL result
resource
mysql_free_result(): supplied argument is not a valid MySQL result
resource
mysql_num_fields(): supplied argument is not a valid MySQL result resource
ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No
buffer to delete or flush.
}}}
It seems heavy use of the @ operator is masking at lease one or two places
where you
perhaps might revise the code so it wouldn't raise an error in the
first place, and you could remove the @ operator. Or you might do
if($x){bla();} instead of just @bla();, making the code less prone to
mishaps.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/9158>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list