[php-src] master: Merge branch 'PHP-8.0'

From: Date: Wed, 28 Apr 2021 09:07:36 +0000
Subject: [php-src] master: Merge branch 'PHP-8.0'
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-115921@lists.php.net to get a copy of this message
Author: Nikita Popov (nikic) Date: 2021-04-28T11:06:54+02:00 Commit: https://github.com/php/php-src/commit/e8ef923dd6f6377c28c58fb64f632d2d4f3e8857 Raw diff: https://github.com/php/php-src/commit/e8ef923dd6f6377c28c58fb64f632d2d4f3e8857.diff Merge branch 'PHP-8.0' * PHP-8.0: Remove assert_options() return value info Changed paths: M Zend/Optimizer/zend_func_info.c M ext/standard/basic_functions.stub.php M ext/standard/basic_functions_arginfo.h M ext/standard/tests/assert/assert_variation.phpt Diff: diff --git a/Zend/Optimizer/zend_func_info.c b/Zend/Optimizer/zend_func_info.c index 8b21f0c7c1fef..c7c11ecb0107b 100644 --- a/Zend/Optimizer/zend_func_info.c +++ b/Zend/Optimizer/zend_func_info.c @@ -404,7 +404,6 @@ static const func_info_t func_infos[] = { F1("array_chunk", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY), F1("array_combine", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY), F1("pos", UNKNOWN_INFO), - F1("assert_options", MAY_BE_NULL | MAY_BE_LONG | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_OBJECT | MAY_BE_OBJECT), F1("str_rot13", MAY_BE_STRING), F1("stream_get_filters", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING), F1("stream_bucket_make_writeable", MAY_BE_NULL | MAY_BE_OBJECT), diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index ac85bce2167c2..15abe44a0f2b9 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -538,7 +538,7 @@ function get_html_translation_table(int $table = HTML_SPECIALCHARS, int $flags = function assert(mixed $assertion, Throwable|string|null $description = null): bool {} -function assert_options(int $option, mixed $value = UNKNOWN): array|object|int|string|null {} +function assert_options(int $option, mixed $value = UNKNOWN): mixed {} /* string.c */ diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index eef802115d737..8e06402c0c536 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 55f11c2d6cc7ba342b1062104f3838866ad9135d */ + * Stub hash: 810b8bfbdf037702fcaec2ff81998c2bc2cefae8 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0) @@ -801,7 +801,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_assert, 0, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_TYPE_MASK(0, description, Throwable, MAY_BE_STRING|MAY_BE_NULL, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_assert_options, 0, 1, MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_LONG|MAY_BE_STRING|MAY_BE_NULL) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_assert_options, 0, 1, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_END_ARG_INFO() diff --git a/ext/standard/tests/assert/assert_variation.phpt b/ext/standard/tests/assert/assert_variation.phpt index ff3d4a1e4dcef..1ed3dad230f96 100644 --- a/ext/standard/tests/assert/assert_variation.phpt +++ b/ext/standard/tests/assert/assert_variation.phpt @@ -68,6 +68,11 @@ var_dump($rao=assert_options(ASSERT_CALLBACK)); echo "ini.get(\"assert.callback\") => [".ini_get("assert.callback")."]\n\n"; var_dump($r2=assert(0 != 0)); echo"\n"; + +echo "Set callback to something silly\n"; +assert_options(ASSERT_CALLBACK, 3.141); +var_dump($rao = assert_options(ASSERT_CALLBACK)); + ?> --EXPECT-- Initial values: assert_options(ASSERT_CALLBACK) => [f1] @@ -126,3 +131,6 @@ ini.get("assert.callback") => [f2] Class assertion failed 60, "assert(0 != 0)" bool(false) + +Set callback to something silly +float(3.141)

« previous php.cvs (#115921) next »