]> granicus.if.org Git - php/commitdiff
Add another round of missing parameter types to stubs
authorMáté Kocsis <kocsismate@woohoolabs.com>
Fri, 7 Aug 2020 14:48:39 +0000 (16:48 +0200)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Fri, 7 Aug 2020 14:48:45 +0000 (16:48 +0200)
Closes GH-5950

45 files changed:
ext/com_dotnet/com_extension.stub.php
ext/com_dotnet/com_extension_arginfo.h
ext/date/php_date.stub.php
ext/date/php_date_arginfo.h
ext/exif/exif.stub.php
ext/exif/exif_arginfo.h
ext/intl/calendar/calendar.stub.php
ext/intl/calendar/calendar_arginfo.h
ext/intl/collator/collator.stub.php
ext/intl/collator/collator_arginfo.h
ext/intl/converter/converter.stub.php
ext/intl/converter/converter_arginfo.h
ext/intl/dateformat/dateformat.stub.php
ext/intl/dateformat/dateformat_arginfo.h
ext/intl/formatter/formatter.stub.php
ext/intl/formatter/formatter_arginfo.h
ext/intl/php_intl.stub.php
ext/intl/php_intl_arginfo.h
ext/intl/spoofchecker/spoofchecker.stub.php
ext/intl/spoofchecker/spoofchecker_arginfo.h
ext/intl/timezone/timezone.stub.php
ext/intl/timezone/timezone_arginfo.h
ext/intl/uchar/uchar.stub.php
ext/intl/uchar/uchar_arginfo.h
ext/ldap/ldap.stub.php
ext/ldap/ldap_arginfo.h
ext/mysqli/mysqli.stub.php
ext/mysqli/mysqli_arginfo.h
ext/pcntl/pcntl.stub.php
ext/pcntl/pcntl_arginfo.h
ext/pdo/pdo_dbh.stub.php
ext/pdo/pdo_dbh_arginfo.h
ext/pdo/pdo_stmt.stub.php
ext/pdo/pdo_stmt_arginfo.h
ext/phar/phar_object.c
ext/phar/phar_object.stub.php
ext/phar/phar_object_arginfo.h
ext/phar/tests/cache_list/files/frontcontroller16.phar.inc
ext/phar/tests/cache_list/frontcontroller31.phpt
ext/phar/tests/files/frontcontroller16.phar.inc
ext/phar/tests/frontcontroller31.phpt
ext/phar/tests/phar_buildfromiterator1.phpt
ext/phar/tests/phar_extract.phpt
ext/spl/spl_directory.stub.php
ext/spl/spl_directory_arginfo.h

index 90c14df5bc72f0341ea5638b8ab237bbd05ebc54..8323b0796b8b310ac90460a7c70bf830b46d0ee4 100644 (file)
@@ -61,6 +61,7 @@ function com_create_guid(): string|false {}
 /** @param array|string|null $sinkinterface */
 function com_event_sink(variant $comobject, object $sinkobject, $sinkinterface = UNKNOWN): bool {}
 
+/** @param com|dotnet|variant|string $comobject */
 function com_print_typeinfo($comobject, ?string $dispinterface = null, bool $wantsink = false): bool {}
 
 function com_message_pump(int $timeoutms = 0): bool {}
index afe2f1b6add27a2c69b672c6176caa13687e7cd1..aec8108d8893e4d4b7796e3b8c00ff954474f0c6 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: caec4bba1103a07a86803ac0192782fef7d6680f */
+ * Stub hash: 48167f9ee38966beaf550cd0a7b07d873575b48e */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_variant_set, 0, 2, IS_VOID, 0)
        ZEND_ARG_OBJ_INFO(0, variant, variant, 0)
index c86b51d7cacb612f117eaca5d8b815bf34d362fc..bb97cf5b86ca8d55f346a8a9fedc810d23ff2a47 100644 (file)
@@ -393,7 +393,12 @@ class DateInterval
 
 class DatePeriod implements IteratorAggregate
 {
-    /* Has an overloaded signature */
+    /**
+     * @param DateTimeInterface|string $start
+     * @param DateInterval|int $interval
+     * @param DateTimeInterface|int $end
+     * @param int $options
+     */
     public function __construct($start, $interval = UNKNOWN, $end = UNKNOWN, $options = UNKNOWN) {}
 
     /** @return DateTimeInterface */
index b15ff5008ceeb12f737c4903ed2750d0e8cd018d..bc12d852bb905e12f60197e17fd3202e9e8a6aa6 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: aa0e2c059662d4015658b85c932126b34934b5a4 */
+ * Stub hash: fee95924adec03c89fdd677ec26bb6eea34d4b3c */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_strtotime, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
        ZEND_ARG_TYPE_INFO(0, datetime, IS_STRING, 0)
index 86e4cc5258e3ebaba774faa52671dda3e23e5d49..9cc099ba2a46555a96c563649839a991f5218726 100644 (file)
@@ -7,7 +7,12 @@ function exif_tagname(int $index): string|false {}
 /** @param resource|string $filename */
 function exif_read_data($filename, ?string $sections_needed = null, bool $sub_arrays = false, bool $read_thumbnail = false): array|false {}
 
-/** @param resource|string $filename */
+/**
+ * @param resource|string $filename
+ * @param int $width
+ * @param int $height
+ * @param int $imagetype
+ */
 function exif_thumbnail($filename, &$width = null, &$height = null, &$imagetype = null): string|false {}
 
 function exif_imagetype(string $filename): int|false {}
index 5edef59fc6db166b525cfafff98b59e49c302b58..b16f457c56d10d0fb644efe2b628ec491c361915 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 62f6ca1a43c69d917711eae9118caf5a658722d9 */
+ * Stub hash: d8cb3719a7de74b27b306c30b6be0af0647b6af4 */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_exif_tagname, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
        ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0)
index d3a7958ee94c81112a42899e2be4001ef199e7a2..bc09ae70a37c8c4cdb633b7eaec75328d791d605 100644 (file)
@@ -235,7 +235,7 @@ class IntlCalendar
      * @return bool
      * @alias intlcal_set
      */
-    public function set(int $year, int $month, int $dayOfMonth = UNKNOWN, $hour = UNKNOWN, int $minute = UNKNOWN, int $second = UNKNOWN) {}
+    public function set(int $year, int $month, int $dayOfMonth = UNKNOWN, int $hour = UNKNOWN, int $minute = UNKNOWN, int $second = UNKNOWN) {}
 
     /**
      * @return bool
@@ -283,6 +283,14 @@ class IntlCalendar
 
 class IntlGregorianCalendar extends IntlCalendar
 {
+    /**
+     * @param DateTimeZone|IntlTimeZone|string|int|null $timeZoneOrYear
+     * @param string|int|null $localeOrMonth
+     * @param int $dayOfMonth
+     * @param int $hour
+     * @param int $minute
+     * @param int $second
+     */
     public function __construct($timeZoneOrYear = UNKNOWN, $localeOrMonth = UNKNOWN, $dayOfMonth = UNKNOWN, $hour = UNKNOWN, $minute = UNKNOWN, $second = UNKNOWN) {}
 
     /**
index 47ea9200fe33ae828fb54b1607df354077306170..99626bd19e42c68bd79a14f0fd9b77782d4b859f 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 8b8a98d5035880031ac42fda5e58bde54c1d85fc */
+ * Stub hash: 3facb6bdce18efae3d6b9594d1fcddfb220dd54d */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlCalendar___construct, 0, 0, 0)
 ZEND_END_ARG_INFO()
@@ -115,7 +115,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlCalendar_set, 0, 0, 2)
        ZEND_ARG_TYPE_INFO(0, year, IS_LONG, 0)
        ZEND_ARG_TYPE_INFO(0, month, IS_LONG, 0)
        ZEND_ARG_TYPE_INFO(0, dayOfMonth, IS_LONG, 0)
-       ZEND_ARG_INFO(0, hour)
+       ZEND_ARG_TYPE_INFO(0, hour, IS_LONG, 0)
        ZEND_ARG_TYPE_INFO(0, minute, IS_LONG, 0)
        ZEND_ARG_TYPE_INFO(0, second, IS_LONG, 0)
 ZEND_END_ARG_INFO()
index 6e8c61c21ab8138ac07b431f821b6b5563c80e54..68a7da192f4506310f93b299769c9a4e6a3d695d 100644 (file)
@@ -22,7 +22,7 @@ class Collator
      * @return bool
      * @alias collator_sort
      */
-    public function sort(array &$arr, $sort_flag = Collator::SORT_REGULAR) {}
+    public function sort(array &$arr, int $sort_flag = Collator::SORT_REGULAR) {}
 
     /**
      * @return bool
index 7d045b35a8bea5bc35deb730410eb43b478e01b5..f0fd448077032364ef044381013f6cca6176e0a8 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 95fee5001472494653e6a83467c3c0079ea70728 */
+ * Stub hash: 4cb1470cf2566c9d947be638c7d14a14a10290dd */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator___construct, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0)
@@ -14,17 +14,14 @@ ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_sort, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(1, arr, IS_ARRAY, 0)
-       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, sort_flag, "Collator::SORT_REGULAR")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sort_flag, IS_LONG, 0, "Collator::SORT_REGULAR")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_sortWithSortKeys, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(1, arr, IS_ARRAY, 0)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_asort, 0, 0, 1)
-       ZEND_ARG_TYPE_INFO(1, arr, IS_ARRAY, 0)
-       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sort_flag, IS_LONG, 0, "Collator::SORT_REGULAR")
-ZEND_END_ARG_INFO()
+#define arginfo_class_Collator_asort arginfo_class_Collator_sort
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_getAttribute, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0)
index fd6aa175b0fdbd4b463f66381db0eb6fbbdded20..f888a78b03601bfc02d9b96ac9999e25ebdaa892 100644 (file)
@@ -9,7 +9,10 @@ class UConverter
     /** @return string|false */
     public function convert(string $str, bool $reverse = false) {}
 
-    /** @return string|null */
+    /**
+     * @param int $error
+     * @return string|null
+     */
     public function fromUCallback(int $reason, array $source, int $codePoint, &$error) {}
 
     /** @return array|false|null */
@@ -54,7 +57,10 @@ class UConverter
     /** @return bool */
     public function setSubstChars(string $chars) {}
 
-    /** @return string|null */
+    /**
+     * @param int $error
+     * @return string|null
+     */
     public function toUCallback(int $reason, string $source, string $codeUnits, &$error) {}
 
     /** @return string|false */
index 5a72ad68eeefd8bcbbd19abc09fdc5ffdd1838cf..513d8e4525841f83a1226e69bf2631f2db32d3c2 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 3c63c9077f864e122292eef8655489549de9277a */
+ * Stub hash: 9eef3fe293c07ab77f4c8b6d8d53a3798f8a9865 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_UConverter___construct, 0, 0, 0)
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, destination_encoding, IS_STRING, 1, "null")
index e86c8c93ada2c6044009f6dc408b560f2c71459f..cdb5aedb03c407781ca0dca67220be1af9a5be20 100644 (file)
@@ -114,12 +114,14 @@ class IntlDateFormatter
     public static function formatObject($object, $format = null, ?string $locale = null) {}
 
     /**
+     * @param int $position
      * @return int|float|false
      * @alias datefmt_parse
      */
     public function parse(string $value, &$position = null) {}
 
     /**
+     * @param int $position
      * @return array|false
      * @alias datefmt_localtime
      */
index 0dadfd9dd06d69c3fa385b2f003610ef3682927d..ae128d8bf9696d11dee388f7bbdc6805faf73e1a 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 86faf2e51b67db2801ce691d4d24bfdae5feb6fc */
+ * Stub hash: e98080c0b9107da6a2bf3ce99929554eb9a3c70e */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter___construct, 0, 0, 3)
        ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1)
index 2d5dc119666a55e9d1356429d3fe3319cbc8fd67..4608c1917d57def4cc446a45092026953ad715ee 100644 (file)
@@ -19,6 +19,7 @@ class NumberFormatter
     public function format(int|float $value, int $type = NumberFormatter::TYPE_DEFAULT) {}
 
     /**
+     * @param int $position
      * @return int|float|false
      * @alias numfmt_parse
      */
@@ -31,6 +32,8 @@ class NumberFormatter
     public function formatCurrency(float $value, string $currency) {}
 
     /**
+     * @param string $currency
+     * @param int $position
      * @return float|false
      * @alias numfmt_parse_currency
      */
index 051a98f941e978533afe1c2ec647cf96c063c875..ffc4eb5018646253c74d13e0b12f8175ea5b5ffc 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 3ff6f141d025bccb37ff597089f00bcc72462627 */
+ * Stub hash: 041569278b83b65f67fb4848d00d5423e6728165 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_NumberFormatter___construct, 0, 0, 2)
        ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0)
index bbb09d03c8d2850edeee61ef093067e011d90529..8cb198e7d678c67194933bcbd4f89678a986451f 100644 (file)
@@ -98,7 +98,14 @@ function intlcal_get_error_code(IntlCalendar $calendar): int|false {}
 
 function intlcal_get_error_message(IntlCalendar $calendar): string|false {}
 
-/** @param IntlTimeZone|DateTimeZone|string|null $timeZone */
+/**
+ * @param DateTimeZone|IntlTimeZone|string|int|null $timeZoneOrYear
+ * @param string|int|null $localeOrMonth
+ * @param int $dayOfMonth
+ * @param int $hour
+ * @param int $minute
+ * @param int $second
+ */
 function intlgregcal_create_instance($timeZoneOrYear = UNKNOWN, $localeOrMonth = UNKNOWN, $dayOfMonth = UNKNOWN, $hour = UNKNOWN, $minute = UNKNOWN, $second = UNKNOWN): ?IntlGregorianCalendar {}
 
 function intlgregcal_set_gregorian_change(IntlGregorianCalendar $calendar, float $change): bool {}
@@ -393,6 +400,10 @@ function intltz_get_gmt(): IntlTimeZone {}
 
 function intltz_get_id(IntlTimeZone $tz): string|false {}
 
+/**
+ * @param int $rawOffset
+ * @param int $dstOffset
+ */
 function intltz_get_offset(IntlTimeZone $tz, float $date, bool $local, &$rawOffset, &$dstOffset): bool {}
 
 function intltz_get_raw_offset(IntlTimeZone $tz): int {}
index 93dcec79e38a5a6eb720a21cdafe8339e574ec3c..d66163c1b5087aad57f72cea4ac1ce2641f113f7 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: ef46b927a82d0bdecea9438ff6ba0000b73b3b56 */
+ * Stub hash: 57c63e06f2c6cf6c58a63081f19fe3e6d6901e88 */
 
 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1)
        ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timeZone, "null")
index 82b749b1eb77faddcc76fab88a3c42ce30e4a3e8..b3f71599796ef9215fb2b7d965bdc493b4b49347 100644 (file)
@@ -6,10 +6,16 @@ class Spoofchecker
 {
     public function __construct() {}
 
-    /** @return bool */
+    /**
+     * @param int $error
+     * @return bool
+     */
     public function isSuspicious(string $text, &$error = null) {}
 
-    /** @return bool */
+    /**
+     * @param int $error
+     * @return bool
+     */
     public function areConfusable(string $s1, string $s2, &$error = null) {}
 
     /** @return void */
index 26ca66080a7e0480802a2f192aa197593816d995..925195fcda3ffc4294ee111525d201443bacc46f 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: dbcdb94753d19921594c48a735d6bd9194b02996 */
+ * Stub hash: 5f4ea7ab66c1748a8de076fca4b62a7d0a235598 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker___construct, 0, 0, 0)
 ZEND_END_ARG_INFO()
index e470ee844052d5e8751322d9a09cac8292040772..5e6208bb73f15b3f90554c3a50b0786f1db7c2a2 100644 (file)
@@ -44,6 +44,7 @@ class IntlTimeZone
     public static function fromDateTimeZone(DateTimeZone $zone) {}
 
     /**
+     * @param bool $isSystemID
      * @return string|false
      * @alias intltz_get_canonical_id
      */
@@ -92,6 +93,8 @@ class IntlTimeZone
     public function getID() {}
 
     /**
+     * @param int $rawOffset
+     * @param int $dstOffset
      * @return bool
      * @alias intltz_get_offset
      */
index 494c46391b5ddb610e3a04d1b94c4441f670307f..b21975eed45311115c723896eb9ae419663d2f6d 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: df98b2edbdf806c52a9c165b52124b6b0de7acb2 */
+ * Stub hash: 94e3c8228a0625a2c5825b0747fb1e5e08808b50 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlTimeZone___construct, 0, 0, 0)
 ZEND_END_ARG_INFO()
index a01552f8c942587a32ceae6daf7675200ef72da6..6f793a61477eb4db90cd3c9b2265020410056fdf 100644 (file)
@@ -47,7 +47,7 @@ class IntlChar
     public static function foldCase(int|string $codepoint, int $options = IntlChar::FOLD_CASE_DEFAULT) {}
 
     /** @return int */
-    public static function forDigit(int $digit, $radix = 10) {}
+    public static function forDigit(int $digit, int $radix = 10) {}
 
 #if U_ICU_VERSION_MAJOR_NUM >= 52
     /** @return int|string|null */
index 6f0175b803e1a7035331a4baf8841703a2078f5a..3ea897c1892706449d650ca7358ba5cff4922aaa 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 2f9658fe9c23180244786ed48a5ca542b7ed95ea */
+ * Stub hash: 61f9c0a6c5048d25e070379f2f98fa10f8ce25ee */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_hasBinaryProperty, 0, 0, 2)
        ZEND_ARG_TYPE_MASK(0, codepoint, MAY_BE_LONG|MAY_BE_STRING, NULL)
@@ -53,7 +53,7 @@ ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlChar_forDigit, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, digit, IS_LONG, 0)
-       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, radix, "10")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, radix, IS_LONG, 0, "10")
 ZEND_END_ARG_INFO()
 
 #if U_ICU_VERSION_MAJOR_NUM >= 52
index 9739ce59c293d312ac17528a87d95644d394b11f..d8851b3314129e9b1824894cef41f02d9bbd006e 100644 (file)
@@ -267,6 +267,11 @@ function ldap_parse_reference($link, $entry, &$referrals): bool {}
 /**
  * @param resource $link
  * @param resource $result
+ * @param int $errcode
+ * @param string $matcheddn
+ * @param string $errmsg
+ * @param array $referrals
+ * @param array $serverctrls
  */
 function ldap_parse_result($link, $result, &$errcode, &$matcheddn = null, &$errmsg = null, &$referrals = null, &$serverctrls = null): bool {}
 #endif
index 94a64918c776ef8728e0949b88bd155afa4d5a7b..078fe220cd4fe055e005287dc3795aa9a2cb6c6a 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: fb889b72e823f3033a54209059f8c6803961cef3 */
+ * Stub hash: 6b5e8ddfbdc436fab3a263d6922146ca7c2f3845 */
 
 #if defined(HAVE_ORALDAP)
 ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_connect, 0, 0, 0)
index 84d95b24d7012c261949a019098f40ac9dd2f37f..7f6bdf880b93c322f7587a122a4b23024934ea0d 100644 (file)
@@ -415,7 +415,7 @@ class mysqli_stmt
      * @return bool
      * @alias mysqli_stmt_bind_result
      */
-    public function bind_result(&...$vars) {}
+    public function bind_result(mixed &...$vars) {}
 
     /**
      * @return bool
index 28145d146089fd7fcdb34fb4c3a9873b221478b4..8f82ead3ed899d08ab10a1d7c54d3b213000dc75 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 0fb73727b9ca9f4fa9827fecd948b60948ddc423 */
+ * Stub hash: 9f7063a0495441cb184f15b895771a32e8ef3195 */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING)
        ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0)
@@ -641,7 +641,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_bind_param, 0, 0, 1)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_bind_result, 0, 0, 0)
-       ZEND_ARG_VARIADIC_INFO(1, vars)
+       ZEND_ARG_VARIADIC_TYPE_INFO(1, vars, IS_MIXED, 0)
 ZEND_END_ARG_INFO()
 
 #define arginfo_class_mysqli_stmt_close arginfo_class_mysqli_character_set_name
index 3c1fd97968a8f378c406e7401dacb883ae05ce92..0c56b0496654319310c1652e4f87bd03b34b0904 100644 (file)
@@ -4,10 +4,16 @@
 
 function pcntl_fork(): int {}
 
-/** @param int $status */
+/**
+ * @param int $status
+ * @param array $rusage
+ */
 function pcntl_waitpid(int $pid, &$status, int $options = 0, &$rusage = []): int {}
 
-/** @param int $status */
+/**
+ * @param int $status
+ * @param array $rusage
+ */
 function pcntl_wait(&$status, int $options = 0, &$rusage = []): int {}
 
 /** @param callable|int $handler */
index 6e67d4613d59c01f5bb5b4f798f44fd26cfd44b4..4c34a762c81e87822089b7759d57638e168668ff 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 243017c5440bff0b3ee3296705d8455d0fac5b7e */
+ * Stub hash: df744f88533ce9b84864fa2aa4dd7a5b7373231d */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_fork, 0, 0, IS_LONG, 0)
 ZEND_END_ARG_INFO()
index bde46dd712e2f2f0bad04d2b21548d12ff48f98b..a35e34e098a2dde0b8e0b6cfd95fe420b960a0c5 100644 (file)
@@ -37,7 +37,7 @@ class PDO
     public function prepare(string $statement, array $driver_options = []) {}
 
     /** @return PDOStatement|false */
-    public function query(string $statement, ?int $fetch_mode = null, ...$fetch_mode_args) {}
+    public function query(string $statement, ?int $fetch_mode = null, mixed ...$fetch_mode_args) {}
 
     /** @return string|false */
     public function quote(string $string, int $parameter_type = PDO::PARAM_STR) {}
index 1057c54665274a9c76e687bebbc7d3d9dd0df164..b5cf1d81d0e7866fcd5bc6889b42774ca0a65bd1 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 36270d1418fc4ddd8f79018372b0ef00fb6f5889 */
+ * Stub hash: 623f0a96bc1ae5eadcac5ba92eb73189cd3230cd */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO___construct, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, dsn, IS_STRING, 0)
@@ -41,7 +41,7 @@ ZEND_END_ARG_INFO()
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_query, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, statement, IS_STRING, 0)
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fetch_mode, IS_LONG, 1, "null")
-       ZEND_ARG_VARIADIC_INFO(0, fetch_mode_args)
+       ZEND_ARG_VARIADIC_TYPE_INFO(0, fetch_mode_args, IS_MIXED, 0)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_quote, 0, 0, 1)
index bab620d627c80eda443138383c69606b9da7af5b..d34607de8c1a84fc5dd21c755cc2b14845b484df 100644 (file)
@@ -4,17 +4,11 @@
 
 class PDOStatement implements IteratorAggregate
 {
-    /**
-     * @param mixed $driverdata
-     * @return bool
-     */
-    public function bindColumn(int|string $column, &$param, int $type = 0, int $maxlen = 0, $driverdata = null) {}
+    /** @return bool */
+    public function bindColumn(int|string $column, &$param, int $type = 0, int $maxlen = 0, mixed $driverdata = null) {}
 
-    /**
-     * @param mixed $driver_options
-     * @return bool
-     */
-    public function bindParam(int|string $parameter, &$param, int $type = PDO::PARAM_STR, int $maxlen = 0, $driverdata = null) {}
+    /** @return bool */
+    public function bindParam(int|string $parameter, &$param, int $type = PDO::PARAM_STR, int $maxlen = 0, mixed $driverdata = null) {}
 
     /**
      * @param int|string $parameter
@@ -75,7 +69,7 @@ class PDOStatement implements IteratorAggregate
     public function setAttribute(int $attribute, $value) {}
 
     /** @return bool */
-    public function setFetchMode(int $mode, ...$params) {}
+    public function setFetchMode(int $mode, mixed ...$params) {}
 
     public function getIterator(): Iterator {}
 }
index aa9227d83bab8e9238a8fd7366d02d319ddb562e..517c15b61471a6d11857d6a7dc2083c869e7954d 100644 (file)
@@ -1,12 +1,12 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 590a642abbc8d54be143a1c595e9e704888e9b5f */
+ * Stub hash: 1802a0ceaa7be9a7644d1b943d2b7d70be23ec75 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindColumn, 0, 0, 2)
        ZEND_ARG_TYPE_MASK(0, column, MAY_BE_LONG|MAY_BE_STRING, NULL)
        ZEND_ARG_INFO(1, param)
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "0")
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maxlen, IS_LONG, 0, "0")
-       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, driverdata, "null")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, driverdata, IS_MIXED, 0, "null")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindParam, 0, 0, 2)
@@ -14,7 +14,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindParam, 0, 0, 2)
        ZEND_ARG_INFO(1, param)
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "PDO::PARAM_STR")
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maxlen, IS_LONG, 0, "0")
-       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, driverdata, "null")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, driverdata, IS_MIXED, 0, "null")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindValue, 0, 0, 2)
@@ -78,7 +78,7 @@ ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_setFetchMode, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0)
-       ZEND_ARG_VARIADIC_INFO(0, params)
+       ZEND_ARG_VARIADIC_TYPE_INFO(0, params, IS_MIXED, 0)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_PDOStatement_getIterator, 0, 0, Iterator, 0)
index c72fecc6e314c62c8d7f7254b9ac6c894670d460..97be3e900c1176bbb6c9bf39b65c9493cfafd428 100644 (file)
@@ -537,7 +537,9 @@ finish: ;
  */
 PHP_METHOD(Phar, webPhar)
 {
-       zval *mimeoverride = NULL, *rewrite = NULL;
+       zval *mimeoverride = NULL;
+       zend_fcall_info rewrite_fci = {0};
+       zend_fcall_info_cache rewrite_fcc;
        char *alias = NULL, *error, *index_php = NULL, *f404 = NULL, *ru = NULL;
        size_t alias_len = 0, f404_len = 0, free_pathinfo = 0;
        size_t ru_len = 0;
@@ -550,7 +552,7 @@ PHP_METHOD(Phar, webPhar)
        phar_entry_info *info = NULL;
        size_t sapi_mod_name_len = strlen(sapi_module.name);
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!saz", &alias, &alias_len, &index_php, &index_php_len, &f404, &f404_len, &mimeoverride, &rewrite) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!saf!", &alias, &alias_len, &index_php, &index_php_len, &f404, &f404_len, &mimeoverride, &rewrite_fci, &rewrite_fcc) == FAILURE) {
                RETURN_THROWS();
        }
 
@@ -668,38 +670,23 @@ PHP_METHOD(Phar, webPhar)
                not_cgi = 1;
        }
 
-       if (rewrite) {
-               zend_fcall_info fci;
-               zend_fcall_info_cache fcc;
+       if (ZEND_FCI_INITIALIZED(rewrite_fci)) {
                zval params, retval;
 
                ZVAL_STRINGL(&params, entry, entry_len);
 
-               if (FAILURE == zend_fcall_info_init(rewrite, 0, &fci, &fcc, NULL, NULL)) {
-                       zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: invalid rewrite callback");
+               rewrite_fci.param_count = 1;
+               rewrite_fci.params = &params;
+               rewrite_fci.retval = &retval;
 
-cleanup_fail:
-                       zval_ptr_dtor(&params);
-                       if (free_pathinfo) {
-                               efree(path_info);
-                       }
-                       efree(entry);
-                       efree(pt);
-                       RETURN_THROWS();
-               }
-
-               fci.param_count = 1;
-               fci.params = &params;
-               fci.retval = &retval;
-
-               if (FAILURE == zend_call_function(&fci, &fcc)) {
+               if (FAILURE == zend_call_function(&rewrite_fci, &rewrite_fcc)) {
                        if (!EG(exception)) {
                                zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: failed to call rewrite callback");
                        }
                        goto cleanup_fail;
                }
 
-               if (Z_TYPE_P(fci.retval) == IS_UNDEF || Z_TYPE(retval) == IS_UNDEF) {
+               if (Z_TYPE_P(rewrite_fci.retval) == IS_UNDEF || Z_TYPE(retval) == IS_UNDEF) {
                        zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: rewrite callback must return a string or false");
                        goto cleanup_fail;
                }
@@ -707,8 +694,8 @@ cleanup_fail:
                switch (Z_TYPE(retval)) {
                        case IS_STRING:
                                efree(entry);
-                               entry = estrndup(Z_STRVAL_P(fci.retval), Z_STRLEN_P(fci.retval));
-                               entry_len = Z_STRLEN_P(fci.retval);
+                               entry = estrndup(Z_STRVAL_P(rewrite_fci.retval), Z_STRLEN_P(rewrite_fci.retval));
+                               entry_len = Z_STRLEN_P(rewrite_fci.retval);
                                break;
                        case IS_TRUE:
                        case IS_FALSE:
@@ -723,7 +710,15 @@ cleanup_fail:
                                return;
                        default:
                                zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: rewrite callback must return a string or false");
-                               goto cleanup_fail;
+
+cleanup_fail:
+                               zval_ptr_dtor(&params);
+                               if (free_pathinfo) {
+                                       efree(path_info);
+                               }
+                               efree(entry);
+                               efree(pt);
+                               RETURN_THROWS();
                }
        }
 
@@ -2703,71 +2698,67 @@ PHP_METHOD(Phar, setAlias)
                RETURN_THROWS();
        }
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &alias, &alias_len) == SUCCESS) {
-               if (alias_len == phar_obj->archive->alias_len && memcmp(phar_obj->archive->alias, alias, alias_len) == 0) {
-                       RETURN_TRUE;
-               }
-               if (alias_len && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len))) {
-                       spprintf(&error, 0, "alias \"%s\" is already used for archive \"%s\" and cannot be used for other archives", alias, fd_ptr->fname);
-                       if (SUCCESS == phar_free_alias(fd_ptr, alias, alias_len)) {
-                               efree(error);
-                               goto valid_alias;
-                       }
-                       zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
+       if (alias_len == phar_obj->archive->alias_len && memcmp(phar_obj->archive->alias, alias, alias_len) == 0) {
+               RETURN_TRUE;
+       }
+       if (alias_len && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len))) {
+               spprintf(&error, 0, "alias \"%s\" is already used for archive \"%s\" and cannot be used for other archives", alias, fd_ptr->fname);
+               if (SUCCESS == phar_free_alias(fd_ptr, alias, alias_len)) {
                        efree(error);
-                       RETURN_THROWS();
-               }
-               if (!phar_validate_alias(alias, alias_len)) {
-                       zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
-                               "Invalid alias \"%s\" specified for phar \"%s\"", alias, phar_obj->archive->fname);
-                       RETURN_THROWS();
+                       goto valid_alias;
                }
+               zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
+               efree(error);
+               RETURN_THROWS();
+       }
+       if (!phar_validate_alias(alias, alias_len)) {
+               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
+                       "Invalid alias \"%s\" specified for phar \"%s\"", alias, phar_obj->archive->fname);
+               RETURN_THROWS();
+       }
 valid_alias:
-               if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
-                       zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
-                       RETURN_THROWS();
-               }
-               if (phar_obj->archive->alias_len && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), phar_obj->archive->alias, phar_obj->archive->alias_len))) {
-                       zend_hash_str_del(&(PHAR_G(phar_alias_map)), phar_obj->archive->alias, phar_obj->archive->alias_len);
-                       readd = 1;
-               }
+       if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+               zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+               RETURN_THROWS();
+       }
+       if (phar_obj->archive->alias_len && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), phar_obj->archive->alias, phar_obj->archive->alias_len))) {
+               zend_hash_str_del(&(PHAR_G(phar_alias_map)), phar_obj->archive->alias, phar_obj->archive->alias_len);
+               readd = 1;
+       }
 
-               oldalias = phar_obj->archive->alias;
-               oldalias_len = phar_obj->archive->alias_len;
-               old_temp = phar_obj->archive->is_temporary_alias;
+       oldalias = phar_obj->archive->alias;
+       oldalias_len = phar_obj->archive->alias_len;
+       old_temp = phar_obj->archive->is_temporary_alias;
 
-               if (alias_len) {
-                       phar_obj->archive->alias = estrndup(alias, alias_len);
-               } else {
-                       phar_obj->archive->alias = NULL;
-               }
+       if (alias_len) {
+               phar_obj->archive->alias = estrndup(alias, alias_len);
+       } else {
+               phar_obj->archive->alias = NULL;
+       }
 
-               phar_obj->archive->alias_len = alias_len;
-               phar_obj->archive->is_temporary_alias = 0;
-               phar_flush(phar_obj->archive, NULL, 0, 0, &error);
+       phar_obj->archive->alias_len = alias_len;
+       phar_obj->archive->is_temporary_alias = 0;
+       phar_flush(phar_obj->archive, NULL, 0, 0, &error);
 
-               if (error) {
-                       phar_obj->archive->alias = oldalias;
-                       phar_obj->archive->alias_len = oldalias_len;
-                       phar_obj->archive->is_temporary_alias = old_temp;
-                       zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
-                       if (readd) {
-                               zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), oldalias, oldalias_len, phar_obj->archive);
-                       }
-                       efree(error);
-                       RETURN_THROWS();
+       if (error) {
+               phar_obj->archive->alias = oldalias;
+               phar_obj->archive->alias_len = oldalias_len;
+               phar_obj->archive->is_temporary_alias = old_temp;
+               zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
+               if (readd) {
+                       zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), oldalias, oldalias_len, phar_obj->archive);
                }
+               efree(error);
+               RETURN_THROWS();
+       }
 
-               zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len, phar_obj->archive);
-
-               if (oldalias) {
-                       efree(oldalias);
-               }
+       zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len, phar_obj->archive);
 
-               RETURN_TRUE;
+       if (oldalias) {
+               efree(oldalias);
        }
 
-       RETURN_FALSE;
+       RETURN_TRUE;
 }
 /* }}} */
 
@@ -4305,19 +4296,22 @@ PHP_METHOD(Phar, extractTo)
        php_stream *fp;
        php_stream_statbuf ssb;
        char *pathto;
-       zend_string *filename;
+       zend_string *filename = NULL;
        size_t pathto_len;
        int ret;
        zval *zval_file;
-       zval *zval_files = NULL;
+       HashTable *files_ht = NULL;
        zend_bool overwrite = 0;
        char *error = NULL;
 
-       PHAR_ARCHIVE_OBJECT();
+       ZEND_PARSE_PARAMETERS_START(1, 3)
+               Z_PARAM_PATH(pathto, pathto_len)
+               Z_PARAM_OPTIONAL
+               Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(filename, files_ht)
+               Z_PARAM_BOOL(overwrite)
+       ZEND_PARSE_PARAMETERS_END();
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|z!b", &pathto, &pathto_len, &zval_files, &overwrite) == FAILURE) {
-               RETURN_THROWS();
-       }
+       PHAR_ARCHIVE_OBJECT();
 
        fp = php_stream_open_wrapper(phar_obj->archive->fname, "rb", IGNORE_URL|STREAM_MUST_SEEK, NULL);
 
@@ -4356,47 +4350,32 @@ PHP_METHOD(Phar, extractTo)
                RETURN_THROWS();
        }
 
-       if (zval_files) {
-               switch (Z_TYPE_P(zval_files)) {
-                       case IS_NULL:
-                               filename = NULL;
-                               break;
-                       case IS_STRING:
-                               filename = Z_STR_P(zval_files);
-                               break;
-                       case IS_ARRAY:
-                               if (zend_hash_num_elements(Z_ARRVAL_P(zval_files)) == 0) {
-                                       RETURN_FALSE;
-                               }
+       if (files_ht) {
+               if (zend_hash_num_elements(files_ht) == 0) {
+                       RETURN_FALSE;
+               }
 
-                               ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(zval_files), zval_file) {
-                                       ZVAL_DEREF(zval_file);
-                                       if (IS_STRING != Z_TYPE_P(zval_file)) {
-                                               zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0,
-                                                       "Invalid argument, array of filenames to extract contains non-string value");
-                                               RETURN_THROWS();
-                                       }
-                                       switch (extract_helper(phar_obj->archive, Z_STR_P(zval_file), pathto, pathto_len, overwrite, &error)) {
-                                               case -1:
-                                                       zend_throw_exception_ex(phar_ce_PharException, 0, "Extraction from phar \"%s\" failed: %s",
-                                                               phar_obj->archive->fname, error);
-                                                       efree(error);
-                                                       RETURN_THROWS();
-                                               case 0:
-                                                       zend_throw_exception_ex(phar_ce_PharException, 0,
-                                                               "phar error: attempted to extract non-existent file or directory \"%s\" from phar \"%s\"",
-                                                               ZSTR_VAL(Z_STR_P(zval_file)), phar_obj->archive->fname);
-                                                       RETURN_THROWS();
-                                       }
-                               } ZEND_HASH_FOREACH_END();
-                               RETURN_TRUE;
-                       default:
+               ZEND_HASH_FOREACH_VAL(files_ht, zval_file) {
+                       ZVAL_DEREF(zval_file);
+                       if (IS_STRING != Z_TYPE_P(zval_file)) {
                                zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0,
-                                       "Invalid argument, expected a filename (string) or array of filenames");
+                                       "Invalid argument, array of filenames to extract contains non-string value");
                                RETURN_THROWS();
-               }
-       } else {
-               filename = NULL;
+                       }
+                       switch (extract_helper(phar_obj->archive, Z_STR_P(zval_file), pathto, pathto_len, overwrite, &error)) {
+                               case -1:
+                                       zend_throw_exception_ex(phar_ce_PharException, 0, "Extraction from phar \"%s\" failed: %s",
+                                               phar_obj->archive->fname, error);
+                                       efree(error);
+                                       RETURN_THROWS();
+                               case 0:
+                                       zend_throw_exception_ex(phar_ce_PharException, 0,
+                                               "phar error: attempted to extract non-existent file or directory \"%s\" from phar \"%s\"",
+                                               ZSTR_VAL(Z_STR_P(zval_file)), phar_obj->archive->fname);
+                                       RETURN_THROWS();
+                       }
+               } ZEND_HASH_FOREACH_END();
+               RETURN_TRUE;
        }
 
        ret = extract_helper(phar_obj->archive, filename, pathto, pathto_len, overwrite, &error);
index fe5fed140602a6532c30c868aaa2118e8b9346a9..7f0eca1034f8ff05b1dceed7e06e6703f8e60ecc 100644 (file)
@@ -58,7 +58,7 @@ class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
     public function delMetadata() {}
 
     /** @return bool */
-    public function extractTo(string $pathto, $files = null, bool $overwrite = false) {}
+    public function extractTo(string $pathto, array|string|null $files = null, bool $overwrite = false) {}
 
     /** @return string|null */
     public function getAlias() {}
@@ -140,7 +140,7 @@ class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
      * @param resource $newstub
      * @return bool
      */
-    public function setStub($newstub, $maxlen = -1) {}
+    public function setStub($newstub, int $maxlen = -1) {}
 
     /** @return void */
     public function startBuffering() {}
@@ -180,13 +180,13 @@ class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
 
     final public static function webPhar(
         ?string $alias = null, ?string $index = null, string $f404 = UNKNOWN,
-        array $mimetypes = [], $rewrites = UNKNOWN): void {}
+        array $mimetypes = [], ?callable $rewrites = null): void {}
 }
 
 class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAccess
 {
     /** @alias Phar::__construct */
-    public function __construct(string $filename, int $flags = FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS, ?string $alias = null, $fileformat = 0) {}
+    public function __construct(string $filename, int $flags = FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS, ?string $alias = null, int $fileformat = 0) {}
 
     /** @alias Phar::__destruct */
     public function __destruct() {}
@@ -285,7 +285,7 @@ class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAcc
      * @return bool
      * @alias Phar::extractTo
      */
-    public function extractTo(string $pathto, $files = null, bool $overwrite = false) {}
+    public function extractTo(string $pathto, array|string|null $files = null, bool $overwrite = false) {}
 
     /**
      * @return string|null
@@ -418,7 +418,7 @@ class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAcc
      * @return bool
      * @alias Phar::setStub
      */
-    public function setStub($newstub, $maxlen = -1) {}
+    public function setStub($newstub, int $maxlen = -1) {}
 
     /**
      * @return void
@@ -479,7 +479,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,
-        array $mimetypes = [], $rewrites = UNKNOWN): void {}
+        array $mimetypes = [], ?callable $rewrites = null): void {}
 }
 
 class PharFileInfo extends SplFileInfo
@@ -519,11 +519,11 @@ class PharFileInfo extends SplFileInfo
     public function hasMetadata() {}
 
     /** @return bool */
-    public function isCompressed($compression_type = 9021976) {}
+    public function isCompressed(int $compression_type = 9021976) {}
 
     /** @return bool */
     public function isCRCChecked() {}
 
     /** @return void */
-    public function setMetadata($metadata) {}
+    public function setMetadata(mixed $metadata) {}
 }
index a4b446d7c5c3590bd75fb785e85b62f37431c075..67b5ba558029f1258832ddc27f2e38b1d1e1f011 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 586c79f097e9153b70f6c6e208daa08acc0ce1d4 */
+ * Stub hash: f25efd47b496a7d06a30c77911a565a49e383bce */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar___construct, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
@@ -74,7 +74,7 @@ ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_extractTo, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, pathto, IS_STRING, 0)
-       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, files, "null")
+       ZEND_ARG_TYPE_MASK(0, files, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, overwrite, _IS_BOOL, 0, "false")
 ZEND_END_ARG_INFO()
 
@@ -139,7 +139,7 @@ ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar_setStub, 0, 0, 1)
        ZEND_ARG_INFO(0, newstub)
-       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, maxlen, "-1")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maxlen, IS_LONG, 0, "-1")
 ZEND_END_ARG_INFO()
 
 #define arginfo_class_Phar_startBuffering arginfo_class_Phar___destruct
@@ -206,14 +206,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Phar_webPhar, 0, 0, IS_VOI
        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, mimetypes, IS_ARRAY, 0, "[]")
-       ZEND_ARG_INFO(0, rewrites)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, rewrites, IS_CALLABLE, 1, "null")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PharData___construct, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FilesystemIterator::SKIP_DOTS | FilesystemIterator::UNIX_PATHS")
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, alias, IS_STRING, 1, "null")
-       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, fileformat, "0")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fileformat, IS_LONG, 0, "0")
 ZEND_END_ARG_INFO()
 
 #define arginfo_class_PharData___destruct arginfo_class_Phar___destruct
@@ -355,12 +355,14 @@ ZEND_END_ARG_INFO()
 #define arginfo_class_PharFileInfo_hasMetadata arginfo_class_Phar___destruct
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PharFileInfo_isCompressed, 0, 0, 0)
-       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, compression_type, "9021976")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, compression_type, IS_LONG, 0, "9021976")
 ZEND_END_ARG_INFO()
 
 #define arginfo_class_PharFileInfo_isCRCChecked arginfo_class_Phar___destruct
 
-#define arginfo_class_PharFileInfo_setMetadata arginfo_class_Phar_setMetadata
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PharFileInfo_setMetadata, 0, 0, 1)
+       ZEND_ARG_TYPE_INFO(0, metadata, IS_MIXED, 0)
+ZEND_END_ARG_INFO()
 
 
 ZEND_METHOD(Phar, __construct);
index 3c9986da00772519001dc67b727df875a99d8e41..442f1fb18f679179c54b7ae26037af4a394315db 100644 (file)
@@ -7,7 +7,7 @@ echo "hi";
 $a->setStub('<?php
 try {
 Phar::webPhar("test.phar", "/index.php", null, array(), array("fail", "here"));
-} catch (Exception $e) {
+} catch (TypeError|Exception $e) {
 die($e->getMessage() . "\n");
 }
 echo "oops did not run\n";
index 54128759f097b0a027f3d901cb664b3ea84665fa..897272999cff625f8e26eb669ef045b8f9312cfa 100644 (file)
@@ -12,5 +12,9 @@ REQUEST_URI=/frontcontroller31.php
 Content-type: text/html; charset=UTF-8
 --FILE_EXTERNAL--
 files/frontcontroller16.phar
---EXPECT--
-phar error: invalid rewrite callback
+--EXPECTF--
+Fatal error: Uncaught TypeError: Phar::webPhar(): Argument #5 ($rewrites) must be a valid callback or null, class "fail" not found in %s:%d
+Stack trace:
+#0 %s(%d): Phar::webPhar('test.phar', '/index.php', '', Array, Array)
+#1 {main}
+  thrown in %s on line %d
index 3c9986da00772519001dc67b727df875a99d8e41..442f1fb18f679179c54b7ae26037af4a394315db 100644 (file)
@@ -7,7 +7,7 @@ echo "hi";
 $a->setStub('<?php
 try {
 Phar::webPhar("test.phar", "/index.php", null, array(), array("fail", "here"));
-} catch (Exception $e) {
+} catch (TypeError|Exception $e) {
 die($e->getMessage() . "\n");
 }
 echo "oops did not run\n";
index a02c937b58da83b6bd9374e375997256babf4a32..0554180b86bcc9eb18aca921b5042de8a624bf9c 100644 (file)
@@ -11,5 +11,9 @@ REQUEST_URI=/frontcontroller31.php
 Content-type: text/html; charset=UTF-8
 --FILE_EXTERNAL--
 files/frontcontroller16.phar
---EXPECT--
-phar error: invalid rewrite callback
+--EXPECTF--
+Fatal error: Uncaught TypeError: Phar::webPhar(): Argument #5 ($rewrites) must be a valid callback or null, class "fail" not found in %s:%d
+Stack trace:
+#0 %s(%d): Phar::webPhar('test.phar', '/index.php', '', Array, Array)
+#1 {main}
+  thrown in %s on line %d
index aac85ff33efffbd8eaa0d3991adf3113c24f43dc..c403e8c939be9f7b4d07194e97a0316c8bd063ba 100644 (file)
@@ -10,7 +10,8 @@ phar.readonly=0
 $phar = new Phar(__DIR__ . '/buildfromiterator1.phar');
 try {
     ini_set('phar.readonly', 1);
-    $phar->buildFromIterator(1);
+
+    $phar->buildFromIterator(new ArrayIterator([]));
 } catch (Exception $e) {
     var_dump(get_class($e));
     echo $e->getMessage() . "\n";
index bbe95dec0dd84a0ce722b535ba93565df1e48886..0ccd9d50d56031d7d40bf1199b8a3fbf55467353 100644 (file)
@@ -45,8 +45,8 @@ var_dump(file_get_contents(__DIR__ . '/extract1-2/file2.txt'));
 var_dump(is_dir(__DIR__ . '/extract1-2/one/level'));
 
 try {
-    $a->extractTo(__DIR__ . '/whatever', 134);
-} catch (Exception $e) {
+    $a->extractTo(__DIR__ . '/whatever', new stdClass());
+} catch (TypeError $e) {
     echo $e->getMessage(), "\n";
 }
 
@@ -141,7 +141,7 @@ string(2) "hi"
 string(3) "hi3"
 string(3) "hi2"
 bool(false)
-Invalid argument, expected a filename (string) or array of filenames
+Phar::extractTo(): Argument #2 ($files) must be of type string|array|null, stdClass given
 Phar::extractTo(): Argument #1 ($pathto) must be a valid path, array given
 Invalid argument, extraction path must be non-zero length
 Unable to use path "%soops" for extraction, it is a file, must be a directory
index 513dfef8aa3a9beb99f328ff68adfdf62d4e3ee9..ce56654eb62f1e7fb7ec6c71187384beaca8f9e2 100755 (executable)
@@ -206,7 +206,7 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator, SeekableIt
     public function fread(int $length) {}
 
     /** @return array|false */
-    public function fgetcsv(string $delimiter = ",", string $enclosure = '"', $escape = "\\") {}
+    public function fgetcsv(string $delimiter = ",", string $enclosure = '"', string $escape = "\\") {}
 
     /** @return int|false */
     public function fputcsv(array $fields, string $delimiter = ',', string $enclosure = '"', string $escape = "\\") {}
@@ -217,7 +217,10 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator, SeekableIt
     /** @return array */
     public function getCsvControl() {}
 
-    /** @return bool */
+    /**
+     * @param int $wouldblock
+     * @return bool
+     */
     public function flock(int $operation, &$wouldblock = null) {}
 
     /** @return bool */
@@ -235,11 +238,8 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator, SeekableIt
     /** @return int */
     public function fpassthru() {}
 
-    /**
-     * @param string $format
-     * @return array|int
-     */
-    public function fscanf(string $format, &...$params) {}
+    /** @return array|int|false|null */
+    public function fscanf(string $format, mixed &...$params) {}
 
     /** @return int|false */
     public function fwrite(string $str, int $length = 0) {}
index 0f167f7f19df5fe56df64143c052eb2aad9bd2f8..57b096caf71f9361216e8af16bcb1c4243a54c0c 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: d6b772ea08c57acdea65e983098f5bc4168daaa6 */
+ * Stub hash: 55701f921c7df2f344dd6b110558fd97efec9891 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileInfo___construct, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, file_name, IS_STRING, 0)
@@ -173,7 +173,7 @@ ZEND_END_ARG_INFO()
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileObject_fgetcsv, 0, 0, 0)
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, delimiter, IS_STRING, 0, "\",\"")
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enclosure, IS_STRING, 0, "\'\"\'")
-       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, escape, "\"\\\\\"")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, escape, IS_STRING, 0, "\"\\\\\"")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileObject_fputcsv, 0, 0, 1)
@@ -211,7 +211,7 @@ ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileObject_fscanf, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0)
-       ZEND_ARG_VARIADIC_INFO(1, params)
+       ZEND_ARG_VARIADIC_TYPE_INFO(1, params, IS_MIXED, 0)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileObject_fwrite, 0, 0, 1)