com php-src: Fix required number of arguments in stubs: Zend/zend_builtin_functions.stub.php Zend/zend_buil tin_functions_arginfo.h
ext/date/php_date.stub.ph p ext/date/php_date_arginfo.h ext/gmp/gmp.stub.ph p ext/gmp/gmp_arginfo.h ext/hash/hash.stub.php ex t/hash/hash_arginfo.h
ext/standard/array.c ext/standa rd/basic_functions.stub.php ext/standard/basic_functi ons_arginfo.h ext/xmlwriter/xmlwriter.stub.php ext/
xmlwriter/xmlwriter_arginfo.h

From: Date: Mon, 07 Oct 2019 14:33:41 +0000
Subject: com php-src: Fix required number of arguments in stubs: Zend/zend_builtin_functions.stub.php Zend/zend_buil tin_functions_arginfo.h
ext/date/php_date.stub.ph p ext/date/php_date_arginfo.h ext/gmp/gmp.stub.ph p ext/gmp/gmp_arginfo.h ext/hash/hash.stub.php ex t/hash/hash_arginfo.h
ext/standard/array.c ext/standa rd/basic_functions.stub.php ext/standard/basic_functi ons_arginfo.h ext/xmlwriter/xmlwriter.stub.php ext/
xmlwriter/xmlwriter_arginfo.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-108767@lists.php.net to get a copy of this message
Commit: 5f80eb7842f377e5f3ad68c58039f3146a9174bd Author: Nikita Popov <nikita.ppv@gmail.com> Mon, 7 Oct 2019 11:25:41 +0200 Parents: c9d4696f763e39c4874907bd6698a711d34b2a75 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5f80eb7842f377e5f3ad68c58039f3146a9174bd Log: Fix required number of arguments in stubs * get_parent_class() argument is optional * Mark array_filter() $callback as optional * The $base of gmp_strval() is optional * DateTime constructor also accepts zero arguments * hash_update_file() stream context is optional * xmlwriter_write_dtd_entity() $isparam argument is optional Changed paths: M Zend/zend_builtin_functions.stub.php M Zend/zend_builtin_functions_arginfo.h M ext/date/php_date.stub.php M ext/date/php_date_arginfo.h M ext/gmp/gmp.stub.php M ext/gmp/gmp_arginfo.h M ext/hash/hash.stub.php M ext/hash/hash_arginfo.h M ext/standard/array.c M ext/standard/basic_functions.stub.php M ext/standard/basic_functions_arginfo.h M ext/xmlwriter/xmlwriter.stub.php M ext/xmlwriter/xmlwriter_arginfo.h

diff --git a/Zend/zend_builtin_functions.stub.php b/Zend/zend_builtin_functions.stub.php index deb9ac92948..c3052db1087 100644 --- a/Zend/zend_builtin_functions.stub.php +++ b/Zend/zend_builtin_functions.stub.php @@ -30,7 +30,7 @@ function get_class(object $object = UNKNOWN) {} function get_called_class() {} /** @return string|false */ -function get_parent_class($object) {} +function get_parent_class($object = UNKNOWN) {} function is_subclass_of($object, string $class_name, bool $allow_string = true): bool {} diff --git a/Zend/zend_builtin_functions_arginfo.h b/Zend/zend_builtin_functions_arginfo.h index 005d148cedb..750b0aa219c 100644 --- a/Zend/zend_builtin_functions_arginfo.h +++ b/Zend/zend_builtin_functions_arginfo.h @@ -48,7 +48,7 @@ ZEND_END_ARG_INFO() #define arginfo_get_called_class arginfo_func_get_args -ZEND_BEGIN_ARG_INFO_EX(arginfo_get_parent_class, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_get_parent_class, 0, 0, 0) ZEND_ARG_INFO(0, object) ZEND_END_ARG_INFO() diff --git a/ext/date/php_date.stub.php b/ext/date/php_date.stub.php index 3d7af39cd29..840efd19c7a 100644 --- a/ext/date/php_date.stub.php +++ b/ext/date/php_date.stub.php @@ -38,10 +38,10 @@ function localtime(int $timestamp = UNKNOWN, bool $associative = false): array { function getdate(int $timestamp = UNKNOWN): array {} /** @return DateTime|false */ -function date_create(string $time, ?DateTimeZone $timezone = null) {} +function date_create(string $time = "now", ?DateTimeZone $timezone = null) {} /** @return DateTime|false */ -function date_create_immutable(string $time, ?DateTimeZone $timezone = null) {} +function date_create_immutable(string $time = "now", ?DateTimeZone $timezone = null) {} /** @return DateTime|false */ function date_create_from_format(string $format, string $time, ?DateTimeZone $timezone = null) {} @@ -158,7 +158,7 @@ interface DateTimeInterface { } class DateTime implements DateTimeInterface { - public function __construct(string $time, ?DateTimeZone $timezone = null); + public function __construct(string $time = "now", ?DateTimeZone $timezone = null); /** @return DateTime */ public static function __set_state(array $array); @@ -195,11 +195,11 @@ class DateTime implements DateTimeInterface { public function setISODate(int $year, int $week, int $day = 1); /** @return DateTime */ - public function setTimestamp(int $timestampt); + public function setTimestamp(int $timestamp); } class DateTimeImmutable implements DateTimeInterface { - public function __construct(string $time, ?DateTimeZone $timezone = null); + public function __construct(string $time = "now", ?DateTimeZone $timezone = null); /** @return DateTimeZone */ public static function __set_state(array $array); diff --git a/ext/date/php_date_arginfo.h b/ext/date/php_date_arginfo.h index 7f67d2e780a..57832f005e4 100644 --- a/ext/date/php_date_arginfo.h +++ b/ext/date/php_date_arginfo.h @@ -50,7 +50,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getdate, 0, 0, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_date_create, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_date_create, 0, 0, 0) ZEND_ARG_TYPE_INFO(0, time, IS_STRING, 0) ZEND_ARG_OBJ_INFO(0, timezone, DateTimeZone, 1) ZEND_END_ARG_INFO() @@ -279,7 +279,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTime_setISODate, 0, 0, 2) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTime_setTimestamp, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, timestampt, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) ZEND_END_ARG_INFO() #define arginfo_class_DateTimeImmutable___construct arginfo_date_create @@ -304,9 +304,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_DateTimeImmutable_setISODate arginfo_class_DateTime_setISODate -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeImmutable_setTimestamp, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) -ZEND_END_ARG_INFO() +#define arginfo_class_DateTimeImmutable_setTimestamp arginfo_class_DateTime_setTimestamp #define arginfo_class_DateTimeZone___construct arginfo_timezone_open diff --git a/ext/gmp/gmp.stub.php b/ext/gmp/gmp.stub.php index e1778f2aa49..1102b0af95a 100644 --- a/ext/gmp/gmp.stub.php +++ b/ext/gmp/gmp.stub.php @@ -22,7 +22,7 @@ function gmp_intval($gmpnumber): int {} * @param GMP|int|bool|string $gmpnumber * @return GMP|false */ -function gmp_strval($gmpnumber, int $base) {} +function gmp_strval($gmpnumber, int $base = 10) {} /** * @param GMP|int|bool|string $a diff --git a/ext/gmp/gmp_arginfo.h b/ext/gmp/gmp_arginfo.h index 8eea02e82c2..c380b9a5267 100644 --- a/ext/gmp/gmp_arginfo.h +++ b/ext/gmp/gmp_arginfo.h @@ -21,7 +21,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_intval, 0, 1, IS_LONG, 0) ZEND_ARG_INFO(0, gmpnumber) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_strval, 0, 0, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_strval, 0, 0, 1) ZEND_ARG_INFO(0, gmpnumber) ZEND_ARG_TYPE_INFO(0, base, IS_LONG, 0) ZEND_END_ARG_INFO() diff --git a/ext/hash/hash.stub.php b/ext/hash/hash.stub.php index 8fc45f7d3f4..5f28ad9799f 100644 --- a/ext/hash/hash.stub.php +++ b/ext/hash/hash.stub.php @@ -21,7 +21,7 @@ function hash_update(HashContext $context, string $data): bool {} function hash_update_stream(HashContext $context, $handle, int $length = -1): int {} /** @param resource $stream_context */ -function hash_update_file(HashContext $context, string $filename, $stream_context): bool {} +function hash_update_file(HashContext $context, string $filename, $stream_context = UNKNOWN): bool {} function hash_final(HashContext $context, bool $raw_output = false): string {} diff --git a/ext/hash/hash_arginfo.h b/ext/hash/hash_arginfo.h index 74c9ca9ee84..6ba7a403cb7 100644 --- a/ext/hash/hash_arginfo.h +++ b/ext/hash/hash_arginfo.h @@ -38,7 +38,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_update_stream, 0, 2, IS_LON ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_update_file, 0, 3, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_update_file, 0, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, HashContext, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_ARG_INFO(0, stream_context) diff --git a/ext/standard/array.c b/ext/standard/array.c index 97b72049957..c8c58413f07 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -6044,7 +6044,7 @@ PHP_FUNCTION(array_reduce) } /* }}} */ -/* {{{ proto array array_filter(array input [, mixed callback]) +/* {{{ proto array array_filter(array input [, mixed callback [, int use_type]]) Filters elements from the array via the callback. */ PHP_FUNCTION(array_filter) { diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 1a1681ae0aa..c85547f7a9a 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -254,7 +254,7 @@ function array_product(array $arg) {} function array_reduce(array $arg, callable $callback, $initial = null) {} -function array_filter(array $arg, callable $callback, int $use_keys = 0): array {} +function array_filter(array $arg, callable $callback = UNKNOWN, int $use_keys = 0): array {} function array_map(?callable $callback, array $arr1, array ...$arrays): array {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 434c4a160d9..8abd27b8a8c 100755 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -327,7 +327,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_array_reduce, 0, 0, 2) ZEND_ARG_INFO(0, initial) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_filter, 0, 2, IS_ARRAY, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_filter, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, arg, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_ARG_TYPE_INFO(0, use_keys, IS_LONG, 0) diff --git a/ext/xmlwriter/xmlwriter.stub.php b/ext/xmlwriter/xmlwriter.stub.php index 823628ffe28..0cdaf3bf394 100644 --- a/ext/xmlwriter/xmlwriter.stub.php +++ b/ext/xmlwriter/xmlwriter.stub.php @@ -80,7 +80,7 @@ function xmlwriter_start_dtd_entity(XMLWriter $xmlwriter, string $name, bool $is function xmlwriter_end_dtd_entity(XMLWriter $xmlwriter): bool {} -function xmlwriter_write_dtd_entity(XMLWriter $xmlwriter, string $name, string $content, bool $isparam, string $publicId = UNKNOWN, string $systemId = UNKNOWN, string $ndataid = UNKNOWN): bool {} +function xmlwriter_write_dtd_entity(XMLWriter $xmlwriter, string $name, string $content, bool $isparam = false, string $publicId = UNKNOWN, string $systemId = UNKNOWN, string $ndataid = UNKNOWN): bool {} function xmlwriter_output_memory(XMLWriter $xmlwriter, bool $flush = true): string {} diff --git a/ext/xmlwriter/xmlwriter_arginfo.h b/ext/xmlwriter/xmlwriter_arginfo.h index 5bda7765758..1a356dd8eb2 100644 --- a/ext/xmlwriter/xmlwriter_arginfo.h +++ b/ext/xmlwriter/xmlwriter_arginfo.h @@ -159,7 +159,7 @@ ZEND_END_ARG_INFO() #define arginfo_xmlwriter_end_dtd_entity arginfo_xmlwriter_start_comment -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xmlwriter_write_dtd_entity, 0, 4, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xmlwriter_write_dtd_entity, 0, 3, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, xmlwriter, XMLWriter, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0)
« previous php.cvs (#108767) next »