diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c index cc272062822..5609b260155 100644 --- a/ext/fileinfo/fileinfo.c +++ b/ext/fileinfo/fileinfo.c @@ -187,7 +187,7 @@ PHP_FUNCTION(finfo_open) char resolved_path[MAXPATHLEN]; zend_error_handling zeh; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lp", &options, &file, &file_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lp!", &options, &file, &file_len) == FAILURE) { RETURN_THROWS(); } diff --git a/ext/fileinfo/fileinfo.stub.php b/ext/fileinfo/fileinfo.stub.php index 76f0444428e..5a9d346c7c3 100644 --- a/ext/fileinfo/fileinfo.stub.php +++ b/ext/fileinfo/fileinfo.stub.php @@ -5,7 +5,7 @@ class finfo { /** @alias finfo_open */ - public function __construct(int $flags = FILEINFO_NONE, string $magic_database = "") {} + public function __construct(int $flags = FILEINFO_NONE, ?string $magic_database = null) {} /** * @param resource|null $context @@ -28,7 +28,7 @@ class finfo public function set_flags(int $flags) {} } -function finfo_open(int $flags = FILEINFO_NONE, string $magic_database = ""): finfo|false {} +function finfo_open(int $flags = FILEINFO_NONE, ?string $magic_database = null): finfo|false {} function finfo_close(finfo $finfo): bool {} diff --git a/ext/fileinfo/fileinfo_arginfo.h b/ext/fileinfo/fileinfo_arginfo.h index 6648c6074cc..2ae31e7b711 100644 --- a/ext/fileinfo/fileinfo_arginfo.h +++ b/ext/fileinfo/fileinfo_arginfo.h @@ -1,9 +1,9 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 6b31c20139e3360cb7ff692cc0d5ccfbfd3812bb */ + * Stub hash: 2cd166d444d7324a9fe70170db434c05ccfbf386 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_finfo_open, 0, 0, finfo, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, magic_database, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, magic_database, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_finfo_close, 0, 1, _IS_BOOL, 0) @@ -35,7 +35,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo___construct, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, magic_database, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, magic_database, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo_file, 0, 0, 1)