summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-05-03 12:58:02 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-05-06 19:15:39 +0200
commit60412c37aea007107e5b3cf03287321216cb58c4 (patch)
tree3afbe241ee1984bb68ee90a8c6af5b6470adac49
parent89d170758777f0f888006dcca8972966ca14ede4 (diff)
downloadphp-git-60412c37aea007107e5b3cf03287321216cb58c4.tar.gz
Fix UNKNOWN default values in ext/xml
-rw-r--r--ext/xml/xml.c2
-rw-r--r--ext/xml/xml.stub.php6
-rw-r--r--ext/xml/xml_arginfo.h6
-rw-r--r--ext/xmlreader/php_xmlreader.c2
-rw-r--r--ext/xmlreader/php_xmlreader.stub.php2
-rw-r--r--ext/xmlreader/php_xmlreader_arginfo.h2
6 files changed, 10 insertions, 10 deletions
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index 4477523edf..802f9a0caa 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -1012,7 +1012,7 @@ static void php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAMETERS, int ns_supp
XML_Char *encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), (ns_support ? "|ss": "|s"), &encoding_param, &encoding_param_len, &ns_param, &ns_param_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), (ns_support ? "|s!s": "|s!"), &encoding_param, &encoding_param_len, &ns_param, &ns_param_len) == FAILURE) {
RETURN_THROWS();
}
diff --git a/ext/xml/xml.stub.php b/ext/xml/xml.stub.php
index 9693eeba81..36c67645c6 100644
--- a/ext/xml/xml.stub.php
+++ b/ext/xml/xml.stub.php
@@ -2,9 +2,9 @@
/** @generate-function-entries */
-function xml_parser_create(string $encoding = UNKNOWN): XmlParser|false {}
+function xml_parser_create(?string $encoding = null): XmlParser|false {}
-function xml_parser_create_ns(string $encoding = UNKNOWN, string $sep = ':'): XmlParser|false {}
+function xml_parser_create_ns(?string $encoding = null, string $sep = ':'): XmlParser|false {}
function xml_set_object(XmlParser $parser, object $obj): bool {}
@@ -40,7 +40,7 @@ function xml_set_end_namespace_decl_handler(XmlParser $parser, $hdl): bool {}
function xml_parse(XmlParser $parser, string $data, bool $isfinal = false): int {}
-function xml_parse_into_struct(XmlParser $parser, string $data, &$values, &$index = UNKNOWN): int {}
+function xml_parse_into_struct(XmlParser $parser, string $data, &$values, &$index = null): int {}
function xml_get_error_code(XmlParser $parser): int {}
diff --git a/ext/xml/xml_arginfo.h b/ext/xml/xml_arginfo.h
index 1e448ac816..e567bbea15 100644
--- a/ext/xml/xml_arginfo.h
+++ b/ext/xml/xml_arginfo.h
@@ -1,11 +1,11 @@
/* This is a generated file, edit the .stub.php file instead. */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_xml_parser_create, 0, 0, XmlParser, MAY_BE_FALSE)
- ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_xml_parser_create_ns, 0, 0, XmlParser, MAY_BE_FALSE)
- ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sep, IS_STRING, 0, "\':\'")
ZEND_END_ARG_INFO()
@@ -49,7 +49,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xml_parse_into_struct, 0, 3, IS_
ZEND_ARG_OBJ_INFO(0, parser, XmlParser, 0)
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
ZEND_ARG_INFO(1, values)
- ZEND_ARG_INFO(1, index)
+ ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, index, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xml_get_error_code, 0, 1, IS_LONG, 0)
diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c
index acb39a7fc9..50715f3db0 100644
--- a/ext/xmlreader/php_xmlreader.c
+++ b/ext/xmlreader/php_xmlreader.c
@@ -811,7 +811,7 @@ PHP_METHOD(XMLReader, next)
xmlreader_object *intern;
char *name = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!", &name, &name_len) == FAILURE) {
RETURN_THROWS();
}
diff --git a/ext/xmlreader/php_xmlreader.stub.php b/ext/xmlreader/php_xmlreader.stub.php
index cbf7bb1bee..9de30e5a7a 100644
--- a/ext/xmlreader/php_xmlreader.stub.php
+++ b/ext/xmlreader/php_xmlreader.stub.php
@@ -47,7 +47,7 @@ class XMLReader
public function read() {}
/** @return bool */
- public function next(string $localname = UNKNOWN) {}
+ public function next(?string $localname = null) {}
/** @return bool|XMLReader */
public static function open(string $URI, ?string $encoding = null, int $options = 0) {}
diff --git a/ext/xmlreader/php_xmlreader_arginfo.h b/ext/xmlreader/php_xmlreader_arginfo.h
index 0b9d28c944..83a5ce6a22 100644
--- a/ext/xmlreader/php_xmlreader_arginfo.h
+++ b/ext/xmlreader/php_xmlreader_arginfo.h
@@ -41,7 +41,7 @@ ZEND_END_ARG_INFO()
#define arginfo_class_XMLReader_read arginfo_class_XMLReader_close
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_next, 0, 0, 0)
- ZEND_ARG_TYPE_INFO(0, localname, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, localname, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_open, 0, 0, 1)