Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
  Fix Bug #81462 mime_content_type() indicates wrong arg num on TypeError
This commit is contained in:
George Peter Banyard 2021-09-20 22:48:46 +01:00
commit 16c98d481f
No known key found for this signature in database
GPG key ID: D49A095D7329F6DC
2 changed files with 5 additions and 5 deletions

View file

@ -335,7 +335,7 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
break;
default:
zend_argument_type_error(2, "must be of type resource|string, %s given", zend_zval_type_name(what));
zend_argument_type_error(1, "must be of type resource|string, %s given", zend_zval_type_name(what));
RETURN_THROWS();
}

View file

@ -41,10 +41,10 @@ try {
?>
--EXPECTF--
mime_content_type(): Argument #2 must be of type resource|string, int given
mime_content_type(): Argument #2 must be of type resource|string, null given
mime_content_type(): Argument #2 must be of type resource|string, stdClass given
mime_content_type(): Argument #2 must be of type resource|string, array given
mime_content_type(): Argument #1 ($filename) must be of type resource|string, int given
mime_content_type(): Argument #1 ($filename) must be of type resource|string, null given
mime_content_type(): Argument #1 ($filename) must be of type resource|string, stdClass given
mime_content_type(): Argument #1 ($filename) must be of type resource|string, array given
Warning: mime_content_type(foo/inexistent): Failed to open stream: No such file or directory in %s on line %d
mime_content_type(): Argument #1 ($filename) cannot be empty