]> granicus.if.org Git - php/commitdiff
Fix UNKNOWN default values in various extensions
authorMáté Kocsis <kocsismate@woohoolabs.com>
Fri, 4 Sep 2020 12:01:09 +0000 (14:01 +0200)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Mon, 7 Sep 2020 17:02:02 +0000 (19:02 +0200)
Closes GH-6075

26 files changed:
ext/gd/gd.c
ext/gd/gd.stub.php
ext/gd/gd_arginfo.h
ext/gd/tests/bug67248.phpt
ext/phar/phar_object.c
ext/phar/phar_object.stub.php
ext/phar/phar_object_arginfo.h
ext/phar/tests/badparameters.phpt
ext/pspell/pspell.c
ext/pspell/pspell.stub.php
ext/pspell/pspell_arginfo.h
ext/simplexml/simplexml.c
ext/simplexml/simplexml.stub.php
ext/simplexml/simplexml_arginfo.h
ext/sockets/sockets.stub.php
ext/sockets/sockets_arginfo.h
ext/spl/spl_directory.c
ext/spl/spl_directory.stub.php
ext/spl/spl_directory_arginfo.h
ext/spl/tests/bug46051.phpt
ext/tidy/tidy.c
ext/tidy/tidy.stub.php
ext/tidy/tidy_arginfo.h
ext/xmlwriter/php_xmlwriter.c
ext/xmlwriter/php_xmlwriter.stub.php
ext/xmlwriter/php_xmlwriter_arginfo.h

index 48dd6ecf4518fa4c22f9e3c706086ba38886a54b..d425b83109a11ea8fef182d72ebfa4d61ceab58b 100644 (file)
@@ -86,7 +86,7 @@ static int le_gd_font;
 #endif
 
 #ifdef HAVE_GD_FREETYPE
-static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int, int);
+static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int);
 #endif
 
 #include "gd_arginfo.h"
@@ -3099,33 +3099,19 @@ PHP_FUNCTION(imagegetclip)
 /* {{{ Give the bounding box of a text using fonts via freetype2 */
 PHP_FUNCTION(imageftbbox)
 {
-       php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_BBOX, 1);
+       php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_BBOX);
 }
 /* }}} */
 
 /* {{{ Write text to the image using fonts via freetype2 */
 PHP_FUNCTION(imagefttext)
 {
-       php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW, 1);
-}
-/* }}} */
-
-/* {{{ Give the bounding box of a text using TrueType fonts */
-PHP_FUNCTION(imagettfbbox)
-{
-       php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_BBOX, 0);
-}
-/* }}} */
-
-/* {{{ Write text to the image using a TrueType font */
-PHP_FUNCTION(imagettftext)
-{
-       php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW, 0);
+       php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW);
 }
 /* }}} */
 
 /* {{{ php_imagettftext_common */
-static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int extended)
+static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode)
 {
        zval *IM, *EXT = NULL;
        gdImagePtr im=NULL;
@@ -3135,19 +3121,14 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
        double ptsize, angle;
        char *str = NULL, *fontname = NULL;
        char *error = NULL;
-       int argc = ZEND_NUM_ARGS();
        gdFTStringExtra strex = {0};
 
        if (mode == TTFTEXT_BBOX) {
-               if (argc < 4 || argc > ((extended) ? 5 : 4)) {
-                       ZEND_WRONG_PARAM_COUNT();
-               } else if (zend_parse_parameters(argc, "ddss|a", &ptsize, &angle, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) {
+               if (zend_parse_parameters(ZEND_NUM_ARGS(), "ddss|a", &ptsize, &angle, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) {
                        RETURN_THROWS();
                }
        } else {
-               if (argc < 8 || argc > ((extended) ? 9 : 8)) {
-                       ZEND_WRONG_PARAM_COUNT();
-               } else if (zend_parse_parameters(argc, "Oddlllss|a", &IM, gd_image_ce, &ptsize, &angle, &x, &y, &col, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) {
+               if (zend_parse_parameters(ZEND_NUM_ARGS(), "Oddlllss|a", &IM, gd_image_ce, &ptsize, &angle, &x, &y, &col, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) {
                        RETURN_THROWS();
                }
                im = php_gd_libgdimageptr_from_zval_p(IM);
@@ -3156,7 +3137,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
        /* convert angle to radians */
        angle = angle * (M_PI/180);
 
-       if (extended && EXT) {  /* parse extended info */
+       if (EXT) {      /* parse extended info */
                zval *item;
                zend_string *key;
 
@@ -3184,7 +3165,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
 
        PHP_GD_CHECK_OPEN_BASEDIR(fontname, "Invalid font filename");
 
-       if (extended) {
+       if (EXT) {
                error = gdImageStringFTEx(im, brect, col, fontname, ptsize, angle, x, y, str, &strex);
        } else {
                error = gdImageStringFT(im, brect, col, fontname, ptsize, angle, x, y, str);
@@ -3819,7 +3800,7 @@ PHP_FUNCTION(imageaffinematrixget)
        zval *tmp;
        int res = GD_FALSE, i;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|z", &type, &options) == FAILURE)  {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "lz", &type, &options) == FAILURE)  {
                RETURN_THROWS();
        }
 
@@ -3827,7 +3808,7 @@ PHP_FUNCTION(imageaffinematrixget)
                case GD_AFFINE_TRANSLATE:
                case GD_AFFINE_SCALE: {
                        double x, y;
-                       if (!options || Z_TYPE_P(options) != IS_ARRAY) {
+                       if (Z_TYPE_P(options) != IS_ARRAY) {
                                zend_argument_type_error(1, "must be of type array when using translate or scale");
                                RETURN_THROWS();
                        }
@@ -3859,11 +3840,6 @@ PHP_FUNCTION(imageaffinematrixget)
                case GD_AFFINE_SHEAR_VERTICAL: {
                        double angle;
 
-                       if (!options) {
-                               zend_argument_type_error(2, "must be of type int|float when using rotate or shear");
-                               RETURN_THROWS();
-                       }
-
                        angle = zval_get_double(options);
 
                        if (type == GD_AFFINE_SHEAR_HORIZONTAL) {
index 7b2e754bad87cdcd396aad25492d0d36fe8026b0..26c8db9b1250471264e63fae6ac0623cb55c5553 100644 (file)
@@ -215,13 +215,15 @@ function imagesetclip(GdImage $im, int $x1, int $x2, int $y1, int $y2): bool {}
 function imagegetclip(GdImage $im): array {}
 
 #ifdef HAVE_GD_FREETYPE
-function imageftbbox(float $size, float $angle, string $font_file, string $text, array $extrainfo = UNKNOWN): array|false {}
+function imageftbbox(float $size, float $angle, string $font_file, string $text, array $extrainfo = []): array|false {}
 
-function imagefttext(GdImage $im, float $size, float $angle, int $x, int $y, int $col, string $font_file, string $text, array $extrainfo = UNKNOWN): array|false {}
+function imagefttext(GdImage $im, float $size, float $angle, int $x, int $y, int $col, string $font_file, string $text, array $extrainfo = []): array|false {}
 
-function imagettfbbox(float $size, float $angle, string $font_file, string $text): array|false {}
+/** @alias imageftbbox */
+function imagettfbbox(float $size, float $angle, string $font_file, string $text, array $extrainfo = []): array|false {}
 
-function imagettftext(GdImage $im, float $size, float $angle, int $x, int $y, int $col, string $font_file, string $text): array|false {}
+/** @alias imagefttext */
+function imagettftext(GdImage $im, float $size, float $angle, int $x, int $y, int $col, string $font_file, string $text, array $extrainfo = []): array|false {}
 #endif
 
 /** @param array|int|float|bool $filter_args */
@@ -241,8 +243,8 @@ function imagescale(GdImage $im, int $new_width, int $new_height = -1, int $mode
 
 function imageaffine(GdImage $im, array $affine, ?array $clip = null): GdImage|false {}
 
-/** @param array|int|float $options */
-function imageaffinematrixget(int $type, $options = UNKNOWN): array|false {}
+/** @param array|float $options */
+function imageaffinematrixget(int $type, $options): array|false {}
 
 function imageaffinematrixconcat(array $m1, array $m2): array|false {}
 
index ca9ee8942619b3778cd99e281f26678a12321730..bd6255b0836f29438dd6a2dad81071f0233d89c6 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 540beb37f18b81102e7977447399757e865285c2 */
+ * Stub hash: 20849891a4907e348f1a509388ab08b0b7f6633d */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gd_info, 0, 0, IS_ARRAY, 0)
 ZEND_END_ARG_INFO()
@@ -459,7 +459,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imageftbbox, 0, 4, MAY_BE_ARRAY|
        ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0)
        ZEND_ARG_TYPE_INFO(0, font_file, IS_STRING, 0)
        ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, extrainfo, IS_ARRAY, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, extrainfo, IS_ARRAY, 0, "[]")
 ZEND_END_ARG_INFO()
 #endif
 
@@ -473,30 +473,16 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imagefttext, 0, 8, MAY_BE_ARRAY|
        ZEND_ARG_TYPE_INFO(0, col, IS_LONG, 0)
        ZEND_ARG_TYPE_INFO(0, font_file, IS_STRING, 0)
        ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, extrainfo, IS_ARRAY, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, extrainfo, IS_ARRAY, 0, "[]")
 ZEND_END_ARG_INFO()
 #endif
 
 #if defined(HAVE_GD_FREETYPE)
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imagettfbbox, 0, 4, MAY_BE_ARRAY|MAY_BE_FALSE)
-       ZEND_ARG_TYPE_INFO(0, size, IS_DOUBLE, 0)
-       ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0)
-       ZEND_ARG_TYPE_INFO(0, font_file, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0)
-ZEND_END_ARG_INFO()
+#define arginfo_imagettfbbox arginfo_imageftbbox
 #endif
 
 #if defined(HAVE_GD_FREETYPE)
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imagettftext, 0, 8, MAY_BE_ARRAY|MAY_BE_FALSE)
-       ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
-       ZEND_ARG_TYPE_INFO(0, size, IS_DOUBLE, 0)
-       ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0)
-       ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0)
-       ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0)
-       ZEND_ARG_TYPE_INFO(0, col, IS_LONG, 0)
-       ZEND_ARG_TYPE_INFO(0, font_file, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0)
-ZEND_END_ARG_INFO()
+#define arginfo_imagettftext arginfo_imagefttext
 #endif
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilter, 0, 2, _IS_BOOL, 0)
@@ -547,7 +533,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imageaffine, 0, 2, GdImage,
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, clip, IS_ARRAY, 1, "null")
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imageaffinematrixget, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imageaffinematrixget, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
        ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0)
        ZEND_ARG_INFO(0, options)
 ZEND_END_ARG_INFO()
@@ -690,12 +676,6 @@ ZEND_FUNCTION(imageftbbox);
 #if defined(HAVE_GD_FREETYPE)
 ZEND_FUNCTION(imagefttext);
 #endif
-#if defined(HAVE_GD_FREETYPE)
-ZEND_FUNCTION(imagettfbbox);
-#endif
-#if defined(HAVE_GD_FREETYPE)
-ZEND_FUNCTION(imagettftext);
-#endif
 ZEND_FUNCTION(imagefilter);
 ZEND_FUNCTION(imageconvolution);
 ZEND_FUNCTION(imageflip);
@@ -832,10 +812,10 @@ static const zend_function_entry ext_functions[] = {
        ZEND_FE(imagefttext, arginfo_imagefttext)
 #endif
 #if defined(HAVE_GD_FREETYPE)
-       ZEND_FE(imagettfbbox, arginfo_imagettfbbox)
+       ZEND_FALIAS(imagettfbbox, imageftbbox, arginfo_imagettfbbox)
 #endif
 #if defined(HAVE_GD_FREETYPE)
-       ZEND_FE(imagettftext, arginfo_imagettftext)
+       ZEND_FALIAS(imagettftext, imagefttext, arginfo_imagettftext)
 #endif
        ZEND_FE(imagefilter, arginfo_imagefilter)
        ZEND_FE(imageconvolution, arginfo_imageconvolution)
index 054ba52861cafc922d9af932090c3cf4bb113c95..5b5e0e8baec37832f76ac68db7ca4fd3eb5e254c 100644 (file)
@@ -11,15 +11,60 @@ require __DIR__ . '/func.inc';
 
 for($i=0;$i<7;$i++) {
     trycatch_dump(
-        fn() => imageaffinematrixget($i)
+        fn() => imageaffinematrixget($i, new stdClass())
     );
 }
 ?>
---EXPECT--
+--EXPECTF--
 !! [TypeError] imageaffinematrixget(): Argument #1 ($type) must be of type array when using translate or scale
 !! [TypeError] imageaffinematrixget(): Argument #1 ($type) must be of type array when using translate or scale
-!! [TypeError] imageaffinematrixget(): Argument #2 ($options) must be of type int|float when using rotate or shear
-!! [TypeError] imageaffinematrixget(): Argument #2 ($options) must be of type int|float when using rotate or shear
-!! [TypeError] imageaffinematrixget(): Argument #2 ($options) must be of type int|float when using rotate or shear
+
+Notice: Object of class stdClass could not be converted to float in %s on line %d
+array(6) {
+  [0]=>
+  float(%f)
+  [1]=>
+  float(%f)
+  [2]=>
+  float(%f)
+  [3]=>
+  float(%f)
+  [4]=>
+  float(0)
+  [5]=>
+  float(0)
+}
+
+Notice: Object of class stdClass could not be converted to float in %s on line %d
+array(6) {
+  [0]=>
+  float(1)
+  [1]=>
+  float(0)
+  [2]=>
+  float(%f)
+  [3]=>
+  float(1)
+  [4]=>
+  float(0)
+  [5]=>
+  float(0)
+}
+
+Notice: Object of class stdClass could not be converted to float in %s on line %d
+array(6) {
+  [0]=>
+  float(1)
+  [1]=>
+  float(%f)
+  [2]=>
+  float(0)
+  [3]=>
+  float(1)
+  [4]=>
+  float(0)
+  [5]=>
+  float(0)
+}
 !! [ValueError] imageaffinematrixget(): Argument #1 ($type) must be a valid element type
 !! [ValueError] imageaffinematrixget(): Argument #1 ($type) must be a valid element type
index efb7048cf6ab57254c95bc1f42495717b8e5dd5a..69b9d3206decab5c270cee40923603d5e11f85c2 100644 (file)
@@ -928,7 +928,7 @@ PHP_METHOD(Phar, createDefaultStub)
        zend_string *stub;
        size_t index_len = 0, webindex_len = 0;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|pp", &index, &index_len, &webindex, &webindex_len) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|p!p!", &index, &index_len, &webindex, &webindex_len) == FAILURE) {
                RETURN_THROWS();
        }
 
@@ -1833,7 +1833,7 @@ PHP_METHOD(Phar, buildFromIterator)
        char *base = NULL;
        struct _phar_t pass;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|s", &obj, zend_ce_traversable, &base, &base_len) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|s!", &obj, zend_ce_traversable, &base, &base_len) == FAILURE) {
                RETURN_THROWS();
        }
 
@@ -2339,7 +2339,7 @@ PHP_METHOD(Phar, convertToExecutable)
        /* a number that is not 0, 1 or 2 (Which is also Greg's birthday, so there) */
        zend_long format = 9021976, method = 9021976;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lls", &format, &method, &ext, &ext_len) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lls!", &format, &method, &ext, &ext_len) == FAILURE) {
                RETURN_THROWS();
        }
 
@@ -2443,7 +2443,7 @@ PHP_METHOD(Phar, convertToData)
        /* a number that is not 0, 1 or 2 (Which is also Greg's birthday so there) */
        zend_long format = 9021976, method = 9021976;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lls", &format, &method, &ext, &ext_len) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lls!", &format, &method, &ext, &ext_len) == FAILURE) {
                RETURN_THROWS();
        }
 
@@ -2992,7 +2992,7 @@ PHP_METHOD(Phar, setSignatureAlgorithm)
        char *error, *key = NULL;
        size_t key_len = 0;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|s", &algo, &key, &key_len) != SUCCESS) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|s!", &algo, &key, &key_len) != SUCCESS) {
                RETURN_THROWS();
        }
 
@@ -3155,7 +3155,7 @@ PHP_METHOD(Phar, compress)
        uint32_t flags;
        zend_object *ret;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|s", &method, &ext, &ext_len) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|s!", &method, &ext, &ext_len) == FAILURE) {
                RETURN_THROWS();
        }
 
@@ -3221,7 +3221,7 @@ PHP_METHOD(Phar, decompress)
        size_t ext_len = 0;
        zend_object *ret;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &ext, &ext_len) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!", &ext, &ext_len) == FAILURE) {
                RETURN_THROWS();
        }
 
@@ -3804,7 +3804,7 @@ PHP_METHOD(Phar, addFile)
        php_stream *resource;
        zval zresource;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|s", &fname, &fname_len, &localname, &localname_len) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|s!", &fname, &fname_len, &localname, &localname_len) == FAILURE) {
                RETURN_THROWS();
        }
 
index da6ab987edd5f1d6b4602fef1532dfcd13aa2c35..e62a95c0383f670b0b6d7c06e8a2eb81307a91da 100644 (file)
@@ -16,16 +16,16 @@ class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
     public function addEmptyDir(string $dirname) {}
 
     /** @return void */
-    public function addFile(string $filename, string $localname = UNKNOWN) {}
+    public function addFile(string $filename, ?string $localname = null) {}
 
     /** @return void */
     public function addFromString(string $localname, string $contents) {}
 
     /** @return array|false */
-    public function buildFromDirectory(string $base_dir, string $regex = UNKNOWN) {}
+    public function buildFromDirectory(string $base_dir, string $regex = "") {}
 
     /** @return array|false */
-    public function buildFromIterator(Traversable $iterator, string $base_directory = UNKNOWN) {}
+    public function buildFromIterator(Traversable $iterator, ?string $base_directory = null) {}
 
     /** @return void */
     public function compressFiles(int $compression_type) {}
@@ -34,22 +34,22 @@ class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
     public function decompressFiles() {}
 
     /** @return Phar|null */
-    public function compress(int $compression_type, string $file_ext = UNKNOWN) {}
+    public function compress(int $compression_type, ?string $file_ext = null) {}
 
     /** @return Phar|null */
-    public function decompress(string $file_ext = UNKNOWN) {}
+    public function decompress(?string $file_ext = null) {}
 
     /** @return Phar|null */
-    public function convertToExecutable(int $format = 9021976, int $compression_type = 9021976, string $file_ext = UNKNOWN) {}
+    public function convertToExecutable(int $format = 9021976, int $compression_type = 9021976, ?string $file_ext = null) {}
 
     /** @return Phar|null */
-    public function convertToData(int $format = 9021976, int $compression_type = 9021976, string $file_ext = UNKNOWN) {}
+    public function convertToData(int $format = 9021976, int $compression_type = 9021976, ?string $file_ext = null) {}
 
     /** @return bool */
     public function copy(string $newfile, string $oldfile) {}
 
     /** @return int */
-    public function count(int $mode = UNKNOWN) {}
+    public function count(int $mode = COUNT_NORMAL) {}
 
     /** @return bool */
     public function delete(string $entry) {}
@@ -131,7 +131,7 @@ class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
     public function setMetadata(mixed $metadata) {}
 
     /** @return void */
-    public function setSignatureAlgorithm(int $algorithm, string $privatekey = UNKNOWN) {}
+    public function setSignatureAlgorithm(int $algorithm, ?string $privatekey = null) {}
 
     /**
      * @param resource $newstub
@@ -151,8 +151,7 @@ class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
 
     final public static function canWrite(): bool {}
 
-    final public static function createDefaultStub(
-        string $index = UNKNOWN, string $webindex = UNKNOWN): string {}
+    final public static function createDefaultStub(?string $index = null, ?string $webindex = null): string {}
 
     final public static function getSupportedCompression(): array {}
 
@@ -176,7 +175,7 @@ class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
     final public static function unlinkArchive(string $archive): bool {}
 
     final public static function webPhar(
-        ?string $alias = null, ?string $index = null, string $f404 = UNKNOWN,
+        ?string $alias = null, ?string $index = null, string $f404 = "",
         array $mimetypes = [], ?callable $rewrites = null): void {}
 }
 
@@ -198,7 +197,7 @@ class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAcc
      * @return void
      * @alias Phar::addFile
      */
-    public function addFile(string $filename, string $localname = UNKNOWN) {}
+    public function addFile(string $filename, ?string $localname = null) {}
 
     /**
      * @return void
@@ -210,13 +209,13 @@ class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAcc
      * @return array|false
      * @alias Phar::buildFromDirectory
      */
-    public function buildFromDirectory(string $base_dir, string $regex = UNKNOWN) {}
+    public function buildFromDirectory(string $base_dir, string $regex = "") {}
 
     /**
      * @return array|false
      * @alias Phar::buildFromIterator
      */
-    public function buildFromIterator(Traversable $iterator, string $base_directory = UNKNOWN) {}
+    public function buildFromIterator(Traversable $iterator, ?string $base_directory = null) {}
 
     /**
      * @return void
@@ -234,25 +233,25 @@ class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAcc
      * @return Phar|null
      * @alias Phar::compress
      */
-    public function compress(int $compression_type, string $file_ext = UNKNOWN) {}
+    public function compress(int $compression_type, ?string $file_ext = null) {}
 
     /**
      * @return Phar|null
      * @alias Phar::decompress
      */
-    public function decompress(string $file_ext = UNKNOWN) {}
+    public function decompress(?string $file_ext = null) {}
 
     /**
      * @return Phar|null
      * @alias Phar::convertToExecutable
      */
-    public function convertToExecutable(int $format = 9021976, int $compression_type = 9021976, string $file_ext = UNKNOWN) {}
+    public function convertToExecutable(int $format = 9021976, int $compression_type = 9021976, ?string $file_ext = null) {}
 
     /**
      * @return Phar|null
      * @alias Phar::convertToData
      */
-    public function convertToData(int $format = 9021976, int $compression_type = 9021976, string $file_ext = UNKNOWN) {}
+    public function convertToData(int $format = 9021976, int $compression_type = 9021976, ?string $file_ext = null) {}
 
     /**
      * @return bool
@@ -264,7 +263,7 @@ class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAcc
      * @return int
      * @alias Phar::count
      */
-    public function count(int $mode = UNKNOWN) {}
+    public function count(int $mode = COUNT_NORMAL) {}
 
     /**
      * @return bool
@@ -407,7 +406,7 @@ class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAcc
      * @return void
      * @alias Phar::setSignatureAlgorithm
      */
-    public function setSignatureAlgorithm(int $algorithm, string $privatekey = UNKNOWN) {}
+    public function setSignatureAlgorithm(int $algorithm, ?string $privatekey = null) {}
 
     /**
      * @param resource $newstub
@@ -438,8 +437,7 @@ class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAcc
     final public static function canWrite(): bool {}
 
     /** @alias Phar::createDefaultStub */
-    final public static function createDefaultStub(
-        string $index = UNKNOWN, string $webindex = UNKNOWN): string {}
+    final public static function createDefaultStub(?string $index = null, ?string $webindex = null): string {}
 
     /** @alias Phar::getSupportedCompression */
     final public static function getSupportedCompression(): array {}
@@ -474,7 +472,7 @@ class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAcc
 
     /** @alias Phar::webPhar */
     final public static function webPhar(
-        ?string $alias = null, ?string $index = null, string $f404 = UNKNOWN,
+        ?string $alias = null, ?string $index = null, string $f404 = "",
         array $mimetypes = [], ?callable $rewrites = null): void {}
 }
 
index e3963fe1a93e8f20d2f8bcd722e95a0ca39d054b..d6c6d5690ed48d3284e4b02056170d1a65bf632a 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: d735d786b6804e336f45ac99c80276f5c67d4258 */
+ * Stub hash: 8f92d8a7b1266cdec193336b36b2319235fbc40c */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar___construct, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
@@ -16,7 +16,7 @@ ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_addFile, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 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_Phar_addFromString, 0, 0, 2)
@@ -26,12 +26,12 @@ ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_buildFromDirectory, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, base_dir, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, regex, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, regex, IS_STRING, 0, "\"\"")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_buildFromIterator, 0, 0, 1)
        ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0)
-       ZEND_ARG_TYPE_INFO(0, base_directory, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, base_directory, IS_STRING, 1, "null")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_compressFiles, 0, 0, 1)
@@ -42,17 +42,17 @@ ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_compress, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, compression_type, IS_LONG, 0)
-       ZEND_ARG_TYPE_INFO(0, file_ext, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, file_ext, IS_STRING, 1, "null")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_decompress, 0, 0, 0)
-       ZEND_ARG_TYPE_INFO(0, file_ext, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, file_ext, IS_STRING, 1, "null")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_convertToExecutable, 0, 0, 0)
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, format, IS_LONG, 0, "9021976")
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, compression_type, IS_LONG, 0, "9021976")
-       ZEND_ARG_TYPE_INFO(0, file_ext, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, file_ext, IS_STRING, 1, "null")
 ZEND_END_ARG_INFO()
 
 #define arginfo_class_Phar_convertToData arginfo_class_Phar_convertToExecutable
@@ -63,7 +63,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_copy, 0, 0, 2)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_count, 0, 0, 0)
-       ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "COUNT_NORMAL")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_delete, 0, 0, 1)
@@ -134,7 +134,7 @@ ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_setSignatureAlgorithm, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, algorithm, IS_LONG, 0)
-       ZEND_ARG_TYPE_INFO(0, privatekey, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, privatekey, IS_STRING, 1, "null")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_setStub, 0, 0, 1)
@@ -157,8 +157,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Phar_canWrite, 0, 0, _IS_B
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Phar_createDefaultStub, 0, 0, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, index, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, webindex, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, index, IS_STRING, 1, "null")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, webindex, IS_STRING, 1, "null")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Phar_getSupportedCompression, 0, 0, IS_ARRAY, 0)
@@ -204,7 +204,7 @@ ZEND_END_ARG_INFO()
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Phar_webPhar, 0, 0, IS_VOID, 0)
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, alias, IS_STRING, 1, "null")
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, index, IS_STRING, 1, "null")
-       ZEND_ARG_TYPE_INFO(0, f404, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, f404, IS_STRING, 0, "\"\"")
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mimetypes, IS_ARRAY, 0, "[]")
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, rewrites, IS_CALLABLE, 1, "null")
 ZEND_END_ARG_INFO()
index 2ad994385cc771ae0f4e57bdbd0ebc16659b6390..47c5d9edfb15337ba661a386be509172c2cca8f8 100644 (file)
@@ -229,7 +229,7 @@ try {
 ?>
 --EXPECTF--
 Phar::mungServer(): Argument #1 ($munglist) must be of type array, string given
-Phar::createDefaultStub(): Argument #1 ($index) must be a valid path, array given
+Phar::createDefaultStub(): Argument #1 ($index) must be a valid path or null, array given
 Phar::loadPhar(): Argument #1 ($filename) must be a valid path, array given
 Phar::canCompress(): Argument #1 ($method) must be of type int, string given
 Phar::__construct(): Argument #1 ($filename) must be a valid path, array given
index ce3242007e2f08f08249af4ed37306a35ca715da..63732b77b087b5eecfd783c84501d048d98acd0e 100644 (file)
@@ -109,7 +109,7 @@ PHP_FUNCTION(pspell_new)
 {
        char *language, *spelling = NULL, *jargon = NULL, *encoding = NULL;
        size_t language_len, spelling_len = 0, jargon_len = 0, encoding_len = 0;
-       zend_long mode = Z_L(0),  speed = Z_L(0);
+       zend_long mode = Z_L(0), speed = Z_L(0);
        int argc = ZEND_NUM_ARGS();
        zval *ind;
 
@@ -167,7 +167,7 @@ PHP_FUNCTION(pspell_new)
                pspell_config_replace(config, "encoding", encoding);
        }
 
-       if (argc > 4) {
+       if (mode) {
                speed = mode & PSPELL_SPEED_MASK_INTERNAL;
 
                /* First check what mode we want (how many suggestions) */
@@ -205,7 +205,7 @@ PHP_FUNCTION(pspell_new_personal)
 {
        char *personal, *language, *spelling = NULL, *jargon = NULL, *encoding = NULL;
        size_t personal_len, language_len, spelling_len = 0, jargon_len = 0, encoding_len = 0;
-       zend_long mode = Z_L(0),  speed = Z_L(0);
+       zend_long mode = Z_L(0), speed = Z_L(0);
        int argc = ZEND_NUM_ARGS();
        zval *ind;
 
@@ -271,7 +271,7 @@ PHP_FUNCTION(pspell_new_personal)
                pspell_config_replace(config, "encoding", encoding);
        }
 
-       if (argc > 5) {
+       if (mode) {
                speed = mode & PSPELL_SPEED_MASK_INTERNAL;
 
                /* First check what mode we want (how many suggestions) */
index 8c549786f2718f6705db43017869f1922e2dc762..03363f46b8a6af2cb0a166ff35d50c145ca89a34 100644 (file)
@@ -2,9 +2,9 @@
 
 /** @generate-function-entries */
 
-function pspell_new(string $language, string $spelling = UNKNOWN, string $jargon = UNKNOWN, string $encoding = UNKNOWN, int $mode = 0): int|false {}
+function pspell_new(string $language, string $spelling = "", string $jargon = "", string $encoding = "", int $mode = 0): int|false {}
 
-function pspell_new_personal(string $personal, string $language, string $spelling = UNKNOWN, string $jargon = UNKNOWN, string $encoding = UNKNOWN, int $mode = 0): int|false {}
+function pspell_new_personal(string $personal, string $language, string $spelling = "", string $jargon = "", string $encoding = "", int $mode = 0): int|false {}
 
 function pspell_new_config(int $config): int|false {}
 
@@ -22,7 +22,7 @@ function pspell_clear_session(int $pspell): bool {}
 
 function pspell_save_wordlist(int $pspell): bool {}
 
-function pspell_config_create(string $language, string $spelling = UNKNOWN, string $jargon = UNKNOWN, string $encoding = UNKNOWN): int {}
+function pspell_config_create(string $language, string $spelling = "", string $jargon = "", string $encoding = ""): int {}
 
 function pspell_config_runtogether(int $conf, bool $runtogether): bool {}
 
index 9f9bf447d6238d58eec6d39d7ac9367f821d8fa7..4a009dec12d042e9861f23cba1f29a5338384c0b 100644 (file)
@@ -1,20 +1,20 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 9103420bb4162cad03e7ee06efa0d1c16820a099 */
+ * Stub hash: 77f9effa6d246cf2b8da121d219462cce8a99918 */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pspell_new, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
        ZEND_ARG_TYPE_INFO(0, language, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, spelling, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, jargon, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, spelling, IS_STRING, 0, "\"\"")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, jargon, IS_STRING, 0, "\"\"")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 0, "\"\"")
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pspell_new_personal, 0, 2, MAY_BE_LONG|MAY_BE_FALSE)
        ZEND_ARG_TYPE_INFO(0, personal, IS_STRING, 0)
        ZEND_ARG_TYPE_INFO(0, language, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, spelling, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, jargon, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, spelling, IS_STRING, 0, "\"\"")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, jargon, IS_STRING, 0, "\"\"")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 0, "\"\"")
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0")
 ZEND_END_ARG_INFO()
 
@@ -50,9 +50,9 @@ ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pspell_config_create, 0, 1, IS_LONG, 0)
        ZEND_ARG_TYPE_INFO(0, language, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, spelling, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, jargon, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, spelling, IS_STRING, 0, "\"\"")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, jargon, IS_STRING, 0, "\"\"")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 0, "\"\"")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pspell_config_runtogether, 0, 2, _IS_BOOL, 0)
index 1944ecf797819ce98a0ac79083299a52a6bbf65a..c941e43ad37b9c20e1f343bd0f7a9a4bc4d7fa88 100644 (file)
@@ -1392,7 +1392,7 @@ SXE_METHOD(asXML)
        char               *filename = NULL;
        size_t                 filename_len;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|p", &filename, &filename_len) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|p!", &filename, &filename_len) == FAILURE) {
                RETURN_THROWS();
        }
 
index 18cddf288616225cf9f6101a32de6546e8ca3feb..d068cb2d713ccdf600b452293cce097dcd502694 100644 (file)
@@ -17,13 +17,13 @@ class SimpleXMLElement implements Stringable, Countable, RecursiveIterator
     public function registerXPathNamespace(string $prefix, string $namespace) {}
 
     /** @return string|bool */
-    public function asXML(string $filename = UNKNOWN) {}
+    public function asXML(?string $filename = null) {}
 
     /**
      * @return string|bool
      * @alias SimpleXMLElement::asXML
      */
-    public function saveXML(string $filename = UNKNOWN) {}
+    public function saveXML(?string $filename = null) {}
 
     /** @return array */
     public function getNamespaces(bool $recursive = false) {}
index 5aa6d50ba1d034345b2b74dd90cfa7c0051cfed2..14624870324acc5d5d35d2faabd19efe37205b3b 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 953089f230247acf18b9ac48c0a4c516d144a987 */
+ * Stub hash: 38b23ba107bcd8a519a2aa70bacbbc6ace9aaa77 */
 
 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_simplexml_load_file, 0, 1, SimpleXMLElement, MAY_BE_FALSE)
        ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
@@ -32,7 +32,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleXMLElement_registerXPathNamespace, 0,
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleXMLElement_asXML, 0, 0, 0)
-       ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null")
 ZEND_END_ARG_INFO()
 
 #define arginfo_class_SimpleXMLElement_saveXML arginfo_class_SimpleXMLElement_asXML
index 7d524dd51c47976cda00c542564d5b73d5ec4290..547374fe97bd5f74079b1340c4d6737eca8f4e0b 100644 (file)
@@ -32,13 +32,13 @@ function socket_read(Socket $socket, int $length, int $type = PHP_BINARY_READ):
  * @param string $addr
  * @param int $port
  */
-function socket_getsockname(Socket $socket, &$addr, &$port = UNKNOWN): bool {}
+function socket_getsockname(Socket $socket, &$addr, &$port = null): bool {}
 
 /**
  * @param string $addr
  * @param int $port
  */
-function socket_getpeername(Socket $socket, &$addr, &$port = UNKNOWN): bool {}
+function socket_getpeername(Socket $socket, &$addr, &$port = null): bool {}
 
 function socket_create(int $domain, int $type, int $protocol): Socket|false {}
 
@@ -58,7 +58,7 @@ function socket_send(Socket $socket, string $buf, int $len, int $flags): int|fal
  * @param string $name
  * @param int $port
  */
-function socket_recvfrom(Socket $socket, &$buf, int $len, int $flags, &$name, &$port = UNKNOWN): int|false {}
+function socket_recvfrom(Socket $socket, &$buf, int $len, int $flags, &$name, &$port = null): int|false {}
 
 function socket_sendto(Socket $socket, string $buf, int $len, int $flags, string $addr, ?int $port = null): int|false {}
 
index f02533324b0365374fb1cf46881fb9b12099c231..e7f4c04799397db1696832abb385da393d7de77e 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 8d03ee514902490691aa4a9b8801fbc10b5b9c26 */
+ * Stub hash: f2d1b412bf2e07c3e607aa6ebad25b19d882b98e */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_socket_select, 0, 4, MAY_BE_LONG|MAY_BE_FALSE)
        ZEND_ARG_TYPE_INFO(1, read_fds, IS_ARRAY, 1)
@@ -48,7 +48,7 @@ ZEND_END_ARG_INFO()
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_socket_getsockname, 0, 2, _IS_BOOL, 0)
        ZEND_ARG_OBJ_INFO(0, socket, Socket, 0)
        ZEND_ARG_INFO(1, addr)
-       ZEND_ARG_INFO(1, port)
+       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, port, "null")
 ZEND_END_ARG_INFO()
 
 #define arginfo_socket_getpeername arginfo_socket_getsockname
@@ -95,7 +95,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_socket_recvfrom, 0, 5, MAY_BE_LO
        ZEND_ARG_TYPE_INFO(0, len, IS_LONG, 0)
        ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0)
        ZEND_ARG_INFO(1, name)
-       ZEND_ARG_INFO(1, port)
+       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, port, "null")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_socket_sendto, 0, 5, MAY_BE_LONG|MAY_BE_FALSE)
index 3f3391334aa7fbc5c7efde614fc3f6113673b215..72fb1cbe8f575c57e7ab4dc2a53d7e06cc1fd82a 100644 (file)
@@ -532,7 +532,7 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int num_args, sp
                        size_t open_mode_len = 1;
                        zval *resource = NULL;
 
-                       if (zend_parse_parameters(num_args, "|sbr",
+                       if (zend_parse_parameters(num_args, "|sbr!",
                                &open_mode, &open_mode_len, &use_include_path, &resource) == FAILURE
                        ) {
                                return NULL;
@@ -1350,7 +1350,7 @@ PHP_METHOD(SplFileInfo, getFileInfo)
        spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
        zend_class_entry *ce = intern->info_class;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C!", &ce) == FAILURE) {
                RETURN_THROWS();
        }
 
@@ -1366,7 +1366,7 @@ PHP_METHOD(SplFileInfo, getPathInfo)
        size_t path_len;
        char *path;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C!", &ce) == FAILURE) {
                RETURN_THROWS();
        }
 
index 3d4f3969223bf15eb1ce100b779da467ca823c51..4691378ca9b713d5b0ce243c7bd39d28c2c702a1 100755 (executable)
@@ -73,16 +73,16 @@ class SplFileInfo
     public function getRealPath() {}
 
     /** @return SplFileInfo */
-    public function getFileInfo(string $class_name = UNKNOWN) {}
+    public function getFileInfo(?string $class_name = null) {}
 
     /** @return SplFileInfo|null */
-    public function getPathInfo(string $class_name = UNKNOWN) {}
+    public function getPathInfo(?string $class_name = null) {}
 
     /**
-     * @param resource $context
+     * @param resource|null $context
      * @return SplFileObject
      */
-    public function openFile(string $open_mode = 'r', bool $use_include_path = false, $context = UNKNOWN) {}
+    public function openFile(string $open_mode = 'r', bool $use_include_path = false, $context = null) {}
 
     /** @return void */
     public function setFileClass(string $class_name = SplFileObject::class) {}
index 02081567593d8ef7ccd795cee8e19cb52ca0e4c4..7442c9c0e88e15cab43432e947806a2961a0c2cf 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 444071056e55fdc44d76db009c92b4d06eba81fb */
+ * Stub hash: 9127cb70a84f3e75ed16a17b15940b8a6b5f3937 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileInfo___construct, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, file_name, IS_STRING, 0)
@@ -53,7 +53,7 @@ ZEND_END_ARG_INFO()
 #define arginfo_class_SplFileInfo_getRealPath arginfo_class_SplFileInfo_getPath
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileInfo_getFileInfo, 0, 0, 0)
-       ZEND_ARG_TYPE_INFO(0, class_name, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, class_name, IS_STRING, 1, "null")
 ZEND_END_ARG_INFO()
 
 #define arginfo_class_SplFileInfo_getPathInfo arginfo_class_SplFileInfo_getFileInfo
@@ -61,7 +61,7 @@ ZEND_END_ARG_INFO()
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileInfo_openFile, 0, 0, 0)
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, open_mode, IS_STRING, 0, "\'r\'")
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_include_path, _IS_BOOL, 0, "false")
-       ZEND_ARG_INFO(0, context)
+       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileInfo_setFileClass, 0, 0, 0)
index 0b3c422905f405ea4ac9f9feba1d842ed3209c23..cebe8a52d7efa1e6e1c1a0964c1b700671a7d2f9 100644 (file)
@@ -6,7 +6,7 @@ Bug #46051 (SplFileInfo::openFile - memory overlap)
 $x = new splfileinfo(__FILE__);
 
 try {
-    $x->openFile(NULL, NULL, NULL);
+    $x->openFile(NULL, NULL, []);
 } catch (TypeError $e) { }
 
 var_dump($x->getPathName());
index 0adb122ff5bb1590c582d9518af75f7bccc002cf..37f9230aad722a54b63ea79c9cf237469a9c98f7 100644 (file)
@@ -998,7 +998,7 @@ PHP_FUNCTION(tidy_parse_string)
                Z_PARAM_STR(input)
                Z_PARAM_OPTIONAL
                Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(options_str, options_ht)
-               Z_PARAM_STRING(enc, enc_len)
+               Z_PARAM_STRING_OR_NULL(enc, enc_len)
        ZEND_PARSE_PARAMETERS_END();
 
        if (ZEND_SIZE_T_UINT_OVFL(ZSTR_LEN(input))) {
@@ -1060,7 +1060,7 @@ PHP_FUNCTION(tidy_parse_file)
                Z_PARAM_PATH_STR(inputfile)
                Z_PARAM_OPTIONAL
                Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(options_str, options_ht)
-               Z_PARAM_STRING(enc, enc_len)
+               Z_PARAM_STRING_OR_NULL(enc, enc_len)
                Z_PARAM_BOOL(use_include_path)
        ZEND_PARSE_PARAMETERS_END();
 
@@ -1353,7 +1353,7 @@ PHP_METHOD(tidy, __construct)
                Z_PARAM_OPTIONAL
                Z_PARAM_PATH_STR_OR_NULL(inputfile)
                Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(options_str, options_ht)
-               Z_PARAM_STRING(enc, enc_len)
+               Z_PARAM_STRING_OR_NULL(enc, enc_len)
                Z_PARAM_BOOL(use_include_path)
        ZEND_PARSE_PARAMETERS_END();
 
@@ -1392,7 +1392,7 @@ PHP_METHOD(tidy, parseFile)
                Z_PARAM_PATH_STR(inputfile)
                Z_PARAM_OPTIONAL
                Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(options_str, options_ht)
-               Z_PARAM_STRING(enc, enc_len)
+               Z_PARAM_STRING_OR_NULL(enc, enc_len)
                Z_PARAM_BOOL(use_include_path)
        ZEND_PARSE_PARAMETERS_END();
 
@@ -1432,7 +1432,7 @@ PHP_METHOD(tidy, parseString)
                Z_PARAM_STR(input)
                Z_PARAM_OPTIONAL
                Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(options_str, options_ht)
-               Z_PARAM_STRING(enc, enc_len)
+               Z_PARAM_STRING_OR_NULL(enc, enc_len)
        ZEND_PARSE_PARAMETERS_END();
 
        if (ZEND_SIZE_T_UINT_OVFL(ZSTR_LEN(input))) {
index 76f4525132cc028a88daae5375e2efc83007b56d..4ae1b5e000c3ea417c2598f1ec9c415459609b00 100644 (file)
@@ -2,19 +2,19 @@
 
 /** @generate-function-entries */
 
-function tidy_parse_string(string $input, array|string|null $config_options = null, string $encoding = UNKNOWN): tidy|false {}
+function tidy_parse_string(string $input, array|string|null $config_options = null, ?string $encoding = null): tidy|false {}
 
 function tidy_get_error_buffer(tidy $object): string|false {}
 
 function tidy_get_output(tidy $object): string {}
 
-function tidy_parse_file(string $file, array|string|null $config_options = null, string $encoding = UNKNOWN, bool $use_include_path = false): tidy|false {}
+function tidy_parse_file(string $file, array|string|null $config_options = null, ?string $encoding = null, bool $use_include_path = false): tidy|false {}
 
 function tidy_clean_repair(tidy $object): bool {}
 
-function tidy_repair_string(string $data, array|string|null $config_options = null, string $encoding = UNKNOWN): string|false {}
+function tidy_repair_string(string $data, array|string|null $config_options = null, ?string $encoding = null): string|false {}
 
-function tidy_repair_file(string $filename, array|string|null $config_options = null, string $encoding = UNKNOWN, bool $use_include_path = false): string|false {}
+function tidy_repair_file(string $filename, array|string|null $config_options = null, ?string $encoding = null, bool $use_include_path = false): string|false {}
 
 function tidy_diagnose(tidy $object): bool {}
 
@@ -54,7 +54,7 @@ function tidy_get_body(tidy $tidy): ?tidyNode {}
 
 class tidy
 {
-    public function __construct(?string $filename = null, array|string|null $config_options = null, string $encoding = UNKNOWN, bool $use_include_path = false) {}
+    public function __construct(?string $filename = null, array|string|null $config_options = null, ?string $encoding = null, bool $use_include_path = false) {}
 
     /**
      * @return string|int|bool
@@ -69,22 +69,22 @@ class tidy
     public function cleanRepair() {}
 
     /** @return bool */
-    public function parseFile(string $file, array|string|null $config_options = null, string $encoding = UNKNOWN, bool $use_include_path = false) {}
+    public function parseFile(string $file, array|string|null $config_options = null, ?string $encoding = null, bool $use_include_path = false) {}
 
     /** @return bool */
-    public function parseString(string $input, array|string|null $config_options = null, string $encoding = UNKNOWN) {}
+    public function parseString(string $input, array|string|null $config_options = null, ?string $encoding = null) {}
 
     /**
      * @return bool
      * @alias tidy_repair_string
      */
-    public function repairString(string $data, array|string|null $config_options = null, string $encoding = UNKNOWN) {}
+    public function repairString(string $data, array|string|null $config_options = null, ?string $encoding = null) {}
 
     /**
      * @return bool
      * @alias tidy_repair_file
      */
-    public function repairFile(string $filename, array|string|null $config_options = null, string $encoding = UNKNOWN, bool $use_include_path = false) {}
+    public function repairFile(string $filename, array|string|null $config_options = null, ?string $encoding = null, bool $use_include_path = false) {}
 
     /**
      * @return bool
index 30ca646812494078d831a64ee9a50f2fd91493f8..ae3617a88f51689f412bcca5212e4135686c2423 100644 (file)
@@ -1,10 +1,10 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: cc7cee7934007aa4b195fb1be0626496937e9d38 */
+ * Stub hash: 62b1cdb7f9b9a5641d3bd9248f5a73c30266d02e */
 
 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_tidy_parse_string, 0, 1, tidy, MAY_BE_FALSE)
        ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0)
        ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
-       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_TYPE_MASK_EX(arginfo_tidy_get_error_buffer, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
@@ -18,7 +18,7 @@ ZEND_END_ARG_INFO()
 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_tidy_parse_file, 0, 1, tidy, MAY_BE_FALSE)
        ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 0)
        ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
-       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, use_include_path, _IS_BOOL, 0, "false")
 ZEND_END_ARG_INFO()
 
@@ -29,13 +29,13 @@ ZEND_END_ARG_INFO()
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_tidy_repair_string, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
        ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
        ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
-       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_TYPE_MASK_EX(arginfo_tidy_repair_file, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
        ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
        ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
-       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, use_include_path, _IS_BOOL, 0, "false")
 ZEND_END_ARG_INFO()
 
@@ -93,7 +93,7 @@ ZEND_END_ARG_INFO()
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidy___construct, 0, 0, 0)
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null")
        ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
-       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, use_include_path, _IS_BOOL, 0, "false")
 ZEND_END_ARG_INFO()
 
@@ -107,26 +107,26 @@ ZEND_END_ARG_INFO()
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidy_parseFile, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 0)
        ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
-       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, use_include_path, _IS_BOOL, 0, "false")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_tidy_parseString, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0)
        ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
-       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_INFO_EX(arginfo_class_tidy_repairString, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
        ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
-       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_INFO_EX(arginfo_class_tidy_repairFile, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
        ZEND_ARG_TYPE_MASK(0, config_options, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
-       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, use_include_path, _IS_BOOL, 0, "false")
 ZEND_END_ARG_INFO()
 
index 3dfaab97ee2a6b1c56690cef988836106c8b571c..6ccd23b37ea66b758fd03fa17f15d9c12e4d294d 100644 (file)
@@ -855,7 +855,7 @@ PHP_FUNCTION(xmlwriter_write_dtd_entity)
        size_t pubid_len, sysid_len, ndataid_len;
        zval *self;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oss|bsss", &self, xmlwriter_class_entry_ce,
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oss|bs!s!s!", &self, xmlwriter_class_entry_ce,
                &name, &name_len, &content, &content_len, &pe, &pubid, &pubid_len,
                &sysid, &sysid_len, &ndataid, &ndataid_len) == FAILURE) {
                RETURN_THROWS();
index 54cdd4ff5607c81710d27d00c8a562c74c4f7242..5b3b4f512b1be3373935ee893055ff91c4bb2cb7 100644 (file)
@@ -206,7 +206,7 @@ class XMLWriter
     public function endDtdEntity(): bool {}
 
     /** @alias xmlwriter_write_dtd_entity */
-    public function writeDtdEntity(string $name, string $content, bool $isparam = false, string $publicId = UNKNOWN, string $systemId = UNKNOWN, string $ndataid = UNKNOWN): bool {}
+    public function writeDtdEntity(string $name, string $content, bool $isparam = false, ?string $publicId = null, ?string $systemId = null, ?string $ndataid = null): bool {}
 
     /** @alias xmlwriter_output_memory */
     public function outputMemory(bool $flush = true): string {}
index cebddf6372fb1a9eb999cb41d166438f019f5a6d..31eeb140aad7eecc65b5eb4addbaffb4d7be452e 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 9323f768ddea26f104b699a9c0ce54e3560b3b32 */
+ * Stub hash: 46bde559f165fc53d75690bfb4d86389202bb19e */
 
 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_xmlwriter_open_uri, 0, 1, XMLWriter, MAY_BE_FALSE)
        ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0)
@@ -314,9 +314,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_writeDtdEntity,
        ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
        ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0)
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, isparam, _IS_BOOL, 0, "false")
-       ZEND_ARG_TYPE_INFO(0, publicId, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, systemId, IS_STRING, 0)
-       ZEND_ARG_TYPE_INFO(0, ndataid, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, publicId, IS_STRING, 1, "null")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, systemId, IS_STRING, 1, "null")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ndataid, IS_STRING, 1, "null")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_outputMemory, 0, 0, IS_STRING, 0)