Homec4science

Respect the "@" operator in PhutilErrorHandler

Authored by epriestley <epriestley@phabricator.com> on Apr 14 2011, 20:59.

Description

Respect the "@" operator in PhutilErrorHandler

Summary:
PHP has an "@" operator which you use like this:

$x = @f();

This silences any warnings emitted by f(). While this is normally silly, a
bunch of builtins spew meaningless or unpreventable warnings because PHP
(probably correctly) assumes that most developers won't check for errors.

For example, stream_select() in Futures spews a lot on my OS X machine but
behaves properly. We check errors correctly so these warnings aren't telling
us anything useful.

Test Plan:
Create a test file with a function which emitted a warning by
reading from an index of an undeclared variable. Called the function twice,
once with @ and once without. Prior to this patch, the script warned twice.
After this patch, the script warned only once.

Reviewed By: tuomaspelkonen
Reviewers: tuomaspelkonen
CC: jungejason, epriestley, tuomaspelkonen
Differential Revision: 134

Details

Committed
epriestley <epriestley@phabricator.com>Apr 14 2011, 21:14
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU9c290ec8e036: Added timestamp to error logging.
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <epriestley@phabricator.com> committed rPHUe6c324cb5c0a: Respect the "@" operator in PhutilErrorHandler (authored by epriestley <epriestley@phabricator.com>).Apr 14 2011, 21:14