From b9b2e8ddde01c7b70e2cb3d9d6e343fc7e109188 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 14 Apr 2020 15:14:40 +0200 Subject: [PATCH] Fix socket_write() default value --- ext/sockets/sockets.stub.php | 2 +- ext/sockets/sockets_arginfo.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/sockets/sockets.stub.php b/ext/sockets/sockets.stub.php index a40e87e4de..5fe5b1cf73 100644 --- a/ext/sockets/sockets.stub.php +++ b/ext/sockets/sockets.stub.php @@ -26,7 +26,7 @@ function socket_listen($socket, int $backlog = 0): bool {} function socket_close($socket): void {} /** @param resource $socket */ -function socket_write($socket, string $buf, int $length = 0): int|false {} +function socket_write($socket, string $buf, int $length = UNKNOWN): int|false {} /** @param resource $socket */ function socket_read($socket, int $length, int $type = PHP_BINARY_READ): string|false {} diff --git a/ext/sockets/sockets_arginfo.h b/ext/sockets/sockets_arginfo.h index 73dcacfe0b..929ad01229 100644 --- a/ext/sockets/sockets_arginfo.h +++ b/ext/sockets/sockets_arginfo.h @@ -35,7 +35,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_socket_write, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_INFO(0, socket) ZEND_ARG_TYPE_INFO(0, buf, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_socket_read, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) -- 2.40.0