airbrake / phpbrake

The official Airbrake PHP error notifier
https://airbrake.io
MIT License
48 stars 36 forks source link

Airbrake\ErrorHandler reports errors that are suppressed with the `@` operator #105

Open fuhry opened 4 years ago

fuhry commented 4 years ago

Currently, if a PHP notice/warning/error occurs that is suppressed using the @ operator, the Airbrake ErrorHandler reports these errors as if they were not suppressed.

Reproduction steps:

$handler = new Airbrake\ErrorHandler($notifier);
$handler->register();

$foo = [];
echo @$foo[0]; // generates E_NOTICE

Expected result: no error is reported

Actual result: error is reported

fuhry commented 4 years ago

Additionally - I've noticed that unit tests are actually enforcing this faulty behavior. Is this intentional?

    private function arrangeOnShutdownNotifier()
    {
        list($notifier, $handler) = $this->makeHandlerBoundNotifier();
        @Troublemaker::echoUndefinedVar();
        $handler->onShutdown();

        return $notifier;
    }

(edit: quoted source)

upsellpl commented 10 months ago

@mmcdaris why it is still unmerged?