Fixes T12190. That task has a good description of the issue.
The old code kind of snuck by PHP5's rules to kind of get the right result. To make this work for PHP7, just wipe the error reporting entirely and explicitly convert any error messages into exceptions.
(This does not use pht() because it may run before pht() loads.)