[php] Fix default_args_runme.php for PHP7.0

This commit is contained in:
Olly Betts 2022-06-12 15:27:49 +12:00
commit b41fede827

View file

@ -47,6 +47,10 @@ check::equal($f->double_if_void_ptr_is_null(7), 14, "\$f->double_if_void_ptr_is_
# then checking for the created object being Null if the PHP version is < 7.3.
if (PHP_MAJOR_VERSION == 7) {
if (PHP_MINOR_VERSION == 0) {
# ArgumentCountError was added in PHP 7.1.
class ArgumentCountError extends Error {}
}
$old_error_handler = set_error_handler(function($n,$s,$f,$l){throw preg_match('/^Wrong parameter count/', $s) ? new ArgumentCountError($s) : new Error($s);});
}