{"action":"created","issue":{"url":"https://api.github.com/repos/getsentry/sentry-php/issues/332","repository_url":"https://api.github.com/repos/getsentry/sentry-php","labels_url":"https://api.github.com/repos/getsentry/sentry-php/issues/332/labels{/name}","comments_url":"https://api.github.com/repos/getsentry/sentry-php/issues/332/comments","events_url":"https://api.github.com/repos/getsentry/sentry-php/issues/332/events","html_url":"https://github.com/getsentry/sentry-php/issues/332","id":169863819,"number":332,"title":"Checking for @ in handleError","user":{"login":"bm-pzegardlo","id":5180671,"avatar_url":"https://avatars.githubusercontent.com/u/5180671?v=3","gravatar_id":"","url":"https://api.github.com/users/bm-pzegardlo","html_url":"https://github.com/bm-pzegardlo","followers_url":"https://api.github.com/users/bm-pzegardlo/followers","following_url":"https://api.github.com/users/bm-pzegardlo/following{/other_user}","gists_url":"https://api.github.com/users/bm-pzegardlo/gists{/gist_id}","starred_url":"https://api.github.com/users/bm-pzegardlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bm-pzegardlo/subscriptions","organizations_url":"https://api.github.com/users/bm-pzegardlo/orgs","repos_url":"https://api.github.com/users/bm-pzegardlo/repos","events_url":"https://api.github.com/users/bm-pzegardlo/events{/privacy}","received_events_url":"https://api.github.com/users/bm-pzegardlo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-08-08T07:58:49Z","updated_at":"2016-09-19T16:57:31Z","closed_at":null,"body":"If PHP expression was prefixed by @ and error occured, error_reporting() will return 0 in registered error handler. This error will not be logged in Sentry cause in handleError there is a checking that error_reporting is not equal to 0.\r\n\r\nThe same will happen if error_reporting would be set to 0 in a global scope, so checking for this in a handleError and handleFatalError function is imho not a good idea. In my opinion handle error function should looks like this:\r\n\r\n```php\r\n       public function handleError($code, $message, $file = '', $line = 0, $context=array())\r\n       {\r\n            $error_types = $this->error_types;\r\n            if ($error_types === null) {\r\n                $error_types = error_reporting();\r\n            }\r\n            if ($error_types & $code) {\r\n                $e = new ErrorException($message, 0, $code, $file, $line);\r\n                $this->handleException($e, true, $context);\r\n            }\r\n            if ($this->call_existing_error_handler) {\r\n                if ($this->old_error_handler !== null) {\r\n                    return call_user_func($this->old_error_handler, $code, $message, $file, $line, $context);\r\n                } else {\r\n                    return false;\r\n                }\r\n            }\r\n       }\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/getsentry/sentry-php/issues/comments/248052201","html_url":"https://github.com/getsentry/sentry-php/issues/332#issuecomment-248052201","issue_url":"https://api.github.com/repos/getsentry/sentry-php/issues/332","id":248052201,"user":{"login":"dcramer","id":23610,"avatar_url":"https://avatars.githubusercontent.com/u/23610?v=3","gravatar_id":"","url":"https://api.github.com/users/dcramer","html_url":"https://github.com/dcramer","followers_url":"https://api.github.com/users/dcramer/followers","following_url":"https://api.github.com/users/dcramer/following{/other_user}","gists_url":"https://api.github.com/users/dcramer/gists{/gist_id}","starred_url":"https://api.github.com/users/dcramer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcramer/subscriptions","organizations_url":"https://api.github.com/users/dcramer/orgs","repos_url":"https://api.github.com/users/dcramer/repos","events_url":"https://api.github.com/users/dcramer/events{/privacy}","received_events_url":"https://api.github.com/users/dcramer/received_events","type":"User","site_admin":false},"created_at":"2016-09-19T16:57:31Z","updated_at":"2016-09-19T16:57:31Z","body":"Ok so the issue is that ``error_get_last`` seems to be NULL when we suppress it in this case. I dont believe that is *always* the case, so instead we're going to bind the \"last error handled\" to the value of ``error_get_last``, which will prevent this from showing up in the shutdown handler."}}
{"actor":{"display_login":"dcramer"}}