Make examples fail on any PHP diagnostic

Previously we called set_error_handler() in tests.php to do this, but
that only sets it for the test-suite.  Now we set it in on the PHP
command line, which works for both.
This commit is contained in:
Olly Betts 2021-04-19 13:17:14 +12:00
commit d6f9f4b6c0
3 changed files with 1 additions and 14 deletions

View file

@ -1,16 +1,5 @@
<?php
function die_on_error($errno, $errstr, $file, $line) {
if ($file !== Null) {
print $file;
if ($line !== Null) print ":$line";
print ": ";
}
print "$errstr\n";
exit(1);
}
set_error_handler("die_on_error", -1);
$_original_functions=get_defined_functions();
$_original_globals=1;
$_original_classes=get_declared_classes();