]> granicus.if.org Git - php/commitdiff
Fix UNKNOWN default values in ext/xml
authorMáté Kocsis <kocsismate@woohoolabs.com>
Sun, 3 May 2020 10:58:02 +0000 (12:58 +0200)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Wed, 6 May 2020 17:15:39 +0000 (19:15 +0200)
ext/xml/xml.c
ext/xml/xml.stub.php
ext/xml/xml_arginfo.h
ext/xmlreader/php_xmlreader.c
ext/xmlreader/php_xmlreader.stub.php
ext/xmlreader/php_xmlreader_arginfo.h

index 4477523edf5f3b5bd4f8ebec6b14900b44532330..802f9a0caa228f0296f3ded2056e9a66dd59e4f7 100644 (file)
@@ -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();
        }
 
index 9693eeba81623d3f310265298eef0705f8b6f213..36c67645c62c64de37a18a4d8f40bb93f7e1d6f8 100644 (file)
@@ -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 {}
 
index 1e448ac8161480a8573220c28a1a92d666450c1a..e567bbea154b2dd8f6f474c17cbeadee46747d72 100644 (file)
@@ -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)
index acb39a7fc973a8caea85a63d84ef3cf8a6af3bc2..50715f3db02446629a0ccd0edc91bff29237e4c3 100644 (file)
@@ -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();
        }
 
index cbf7bb1beec45a8fa0d0b84fe0941892cb5a4e6f..9de30e5a7afd9ed5e080801f77f23276f6a847f3 100644 (file)
@@ -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) {}
index 0b9d28c94405da8b9fcdf5a64c1e242548060ef1..83a5ce6a22854713111b9fc49d44d9cdf859e1c4 100644 (file)
@@ -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)