Skip to content

Commit e8ef923

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Remove assert_options() return value info
2 parents bd5419a + 76d1120 commit e8ef923

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

Zend/Optimizer/zend_func_info.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ static const func_info_t func_infos[] = {
404404
F1("array_chunk", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
405405
F1("array_combine", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
406406
F1("pos", UNKNOWN_INFO),
407-
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),
408407
F1("str_rot13", MAY_BE_STRING),
409408
F1("stream_get_filters", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
410409
F1("stream_bucket_make_writeable", MAY_BE_NULL | MAY_BE_OBJECT),

ext/standard/basic_functions.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ function get_html_translation_table(int $table = HTML_SPECIALCHARS, int $flags =
538538

539539
function assert(mixed $assertion, Throwable|string|null $description = null): bool {}
540540

541-
function assert_options(int $option, mixed $value = UNKNOWN): array|object|int|string|null {}
541+
function assert_options(int $option, mixed $value = UNKNOWN): mixed {}
542542

543543
/* string.c */
544544

ext/standard/basic_functions_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 55f11c2d6cc7ba342b1062104f3838866ad9135d */
2+
* Stub hash: 810b8bfbdf037702fcaec2ff81998c2bc2cefae8 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
55
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)
801801
ZEND_ARG_OBJ_TYPE_MASK(0, description, Throwable, MAY_BE_STRING|MAY_BE_NULL, "null")
802802
ZEND_END_ARG_INFO()
803803

804-
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)
804+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_assert_options, 0, 1, IS_MIXED, 0)
805805
ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0)
806806
ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
807807
ZEND_END_ARG_INFO()

ext/standard/tests/assert/assert_variation.phpt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ var_dump($rao=assert_options(ASSERT_CALLBACK));
6868
echo "ini.get(\"assert.callback\") => [".ini_get("assert.callback")."]\n\n";
6969
var_dump($r2=assert(0 != 0));
7070
echo"\n";
71+
72+
echo "Set callback to something silly\n";
73+
assert_options(ASSERT_CALLBACK, 3.141);
74+
var_dump($rao = assert_options(ASSERT_CALLBACK));
75+
7176
?>
7277
--EXPECT--
7378
Initial values: assert_options(ASSERT_CALLBACK) => [f1]
@@ -126,3 +131,6 @@ ini.get("assert.callback") => [f2]
126131

127132
Class assertion failed 60, "assert(0 != 0)"
128133
bool(false)
134+
135+
Set callback to something silly
136+
float(3.141)

0 commit comments

Comments
 (0)