{"action":"created","issue":{"url":"https://api.github.com/repos/filp/whoops/issues/284","labels_url":"https://api.github.com/repos/filp/whoops/issues/284/labels{/name}","comments_url":"https://api.github.com/repos/filp/whoops/issues/284/comments","events_url":"https://api.github.com/repos/filp/whoops/issues/284/events","html_url":"https://github.com/filp/whoops/pull/284","id":78700893,"number":284,"title":"PHP7 and EngineException handling","user":{"login":"adduc","id":44527,"avatar_url":"https://avatars.githubusercontent.com/u/44527?v=3","gravatar_id":"","url":"https://api.github.com/users/adduc","html_url":"https://github.com/adduc","followers_url":"https://api.github.com/users/adduc/followers","following_url":"https://api.github.com/users/adduc/following{/other_user}","gists_url":"https://api.github.com/users/adduc/gists{/gist_id}","starred_url":"https://api.github.com/users/adduc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adduc/subscriptions","organizations_url":"https://api.github.com/users/adduc/orgs","repos_url":"https://api.github.com/users/adduc/repos","events_url":"https://api.github.com/users/adduc/events{/privacy}","received_events_url":"https://api.github.com/users/adduc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-05-20T21:16:58Z","updated_at":"2015-05-21T10:33:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/filp/whoops/pulls/284","html_url":"https://github.com/filp/whoops/pull/284","diff_url":"https://github.com/filp/whoops/pull/284.diff","patch_url":"https://github.com/filp/whoops/pull/284.patch"},"body":"PHP7 introduces a few new classes related to Exception ([RFC](https://wiki.php.net/rfc/engine_exceptions)). BaseException is created as a parent of Exception, and EngineException is created as a child of BaseException. As a result, the exception handler may receive objects that do not match Exception (EngineException is not an instance of Exception).\r\n\r\nIf we were to aim for PHP 7 compatibility only, I'd suggest changing all typehints in Whoops to BaseException, to allow for both Exceptions and EngineExceptions to be passed throughout.\r\n\r\nIf we were to aim for PHP 5 and PHP 7 compatibility, as suggested by @LawnGnome, we would need to get rid of the type hint in the exception handler ([Run::handleException](https://github.com/filp/whoops/blob/c982fe62c44798c433229cb0425c61b487cc1883/src/Whoops/Run.php#L233)). We would also need to remove all other typehints for Exception, as they would also need to handle both Exception and EngineException.\r\n\r\nI'm opening this pull request to start discussion, I don't intend for the changes within to be merged without further refinement (still working on a unit test to test catching EngineException)."},"comment":{"url":"https://api.github.com/repos/filp/whoops/issues/comments/104220715","html_url":"https://github.com/filp/whoops/pull/284#issuecomment-104220715","issue_url":"https://api.github.com/repos/filp/whoops/issues/284","id":104220715,"user":{"login":"staabm","id":120441,"avatar_url":"https://avatars.githubusercontent.com/u/120441?v=3","gravatar_id":"","url":"https://api.github.com/users/staabm","html_url":"https://github.com/staabm","followers_url":"https://api.github.com/users/staabm/followers","following_url":"https://api.github.com/users/staabm/following{/other_user}","gists_url":"https://api.github.com/users/staabm/gists{/gist_id}","starred_url":"https://api.github.com/users/staabm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/staabm/subscriptions","organizations_url":"https://api.github.com/users/staabm/orgs","repos_url":"https://api.github.com/users/staabm/repos","events_url":"https://api.github.com/users/staabm/events{/privacy}","received_events_url":"https://api.github.com/users/staabm/received_events","type":"User","site_admin":false},"created_at":"2015-05-21T10:33:59Z","updated_at":"2015-05-21T10:33:59Z","body":"Right, JUNE says RC. Since I expect at least 5-8 beta+alpha releases I think they are not on schedule.\r\nWe should at least wait for the 2nd or 3rd alpha."}}