Improve top-level fatal exception handling in PHP 7+
Depends on D20137. Ref T13250. Ref T12101. In versions of PHP beyond 7, various engine errors are gradually changing from internal fatals or internal errors to Throwables, a superclass of Exception.
This is generally a good change, but code written against PHP 5.x before Throwable was introduced may not catch these errors, even when the code is intended to be a top-level exception handler.
(The double-catch pattern here and elsewhere is because Throwable does not exist in older PHP, so catch (Throwable $ex) catches nothing. The Exception $ex clause catches everything in old PHP, the Throwable $ex clause catches everything in newer PHP.)
Generalize some Exception into Throwable.
- Added a bogus function call to the rendering stack.
- Before change: got a blank page.
- After change: nice exception page.
Reviewed By: amckinley
Differential Revision: https://secure.phabricator.com/D20138