HomePhabricator

Improve PHP7 error reporting for include-time syntax errors

Description

Improve PHP7 error reporting for include-time syntax errors

Summary:
Ref T12101. Ref T12855. Ref T12190.

In PHP7, include_once may raise a Throwable which has a useless message and stack trace (neither point at the actual file or line where the error occurs).

Catch and mangle these so they're useful. This upgrades the message from syntax error: unexpected X so it has a file and line number.

Test Plan:

Screen Shot 2017-11-28 at 6.03.12 AM.png (1×1 px, 220 KB)

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T12855, T12190, T12101

Differential Revision: https://secure.phabricator.com/D18797