Skip to content

Commit e60f927

Browse files
committed
stream_bucket_new() cannot return false
php_stream_bucket_new() is infallible.
1 parent 9ef2c5c commit e60f927

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

ext/opcache/Optimizer/zend_func_info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ static const func_info_t func_infos[] = {
409409
F1("str_rot13", MAY_BE_STRING),
410410
F1("stream_get_filters", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
411411
F1("stream_bucket_make_writeable", MAY_BE_NULL | MAY_BE_OBJECT),
412-
F1("stream_bucket_new", MAY_BE_FALSE | MAY_BE_OBJECT),
412+
F1("stream_bucket_new", MAY_BE_OBJECT),
413413
F1("sys_get_temp_dir", MAY_BE_STRING),
414414

415415
/* ext/date */

ext/standard/basic_functions.stub.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,6 +1445,8 @@ function rawurldecode(string $string): string {}
14451445
/** @param resource $context */
14461446
function get_headers(string $url, int $format = 0, $context = null): array|false {}
14471447

1448+
/* user_filters.c */
1449+
14481450
/** @param resource $brigade */
14491451
function stream_bucket_make_writeable($brigade): ?object {}
14501452

@@ -1455,7 +1457,7 @@ function stream_bucket_prepend($brigade, object $bucket): void {}
14551457
function stream_bucket_append($brigade, object $bucket): void {}
14561458

14571459
/** @param resource $stream */
1458-
function stream_bucket_new($stream, string $buffer): object|false {}
1460+
function stream_bucket_new($stream, string $buffer): object {}
14591461

14601462
function stream_get_filters(): array {}
14611463

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: c61d8a28acaa2a7206f74287dce98282f2fedd2a */
2+
* Stub hash: 621176b0f79f4fcb833c6be568adb2070239cce1 */
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)
@@ -2146,7 +2146,7 @@ ZEND_END_ARG_INFO()
21462146

21472147
#define arginfo_stream_bucket_append arginfo_stream_bucket_prepend
21482148

2149-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_bucket_new, 0, 2, MAY_BE_OBJECT|MAY_BE_FALSE)
2149+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_bucket_new, 0, 2, IS_OBJECT, 0)
21502150
ZEND_ARG_INFO(0, stream)
21512151
ZEND_ARG_TYPE_INFO(0, buffer, IS_STRING, 0)
21522152
ZEND_END_ARG_INFO()

ext/standard/user_filters.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,10 +500,6 @@ PHP_FUNCTION(stream_bucket_new)
500500

501501
bucket = php_stream_bucket_new(stream, pbuffer, buffer_len, 1, php_stream_is_persistent(stream));
502502

503-
if (bucket == NULL) {
504-
RETURN_FALSE;
505-
}
506-
507503
ZVAL_RES(&zbucket, zend_register_resource(bucket, le_bucket));
508504
object_init(return_value);
509505
add_property_zval(return_value, "bucket", &zbucket);

0 commit comments

Comments
 (0)