summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-02-10 12:21:15 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-02-10 12:21:15 +0100
commit89c55afeb570acaed6c07c404379aed58ca498ed (patch)
treea0a1044d3abc91f3e0cc30db0f36befcc52cdaf7
parent6cef8508b48a40e09e24dc7805d9daf06f218e55 (diff)
parentfd5ff37db77b52b39d97c5749dcbbf4b09c10d9d (diff)
downloadphp-git-89c55afeb570acaed6c07c404379aed58ca498ed.tar.gz
Merge branch 'PHP-8.0'
* PHP-8.0: Make finfo_open() $magic_database nullable
-rw-r--r--ext/fileinfo/fileinfo.c2
-rw-r--r--ext/fileinfo/fileinfo.stub.php4
-rw-r--r--ext/fileinfo/fileinfo_arginfo.h6
3 files changed, 6 insertions, 6 deletions
diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c
index cc27206282..5609b26015 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 76f0444428..5a9d346c7c 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 6648c6074c..2ae31e7b71 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)