]> granicus.if.org Git - php/commitdiff
Fix socket_write() default value
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 14 Apr 2020 13:14:40 +0000 (15:14 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 14 Apr 2020 14:08:55 +0000 (16:08 +0200)
ext/sockets/sockets.stub.php
ext/sockets/sockets_arginfo.h

index a40e87e4de63c7d84b4c971b38b8c29a737a2eea..5fe5b1cf7347f4fbd61fcd527d7b96ee2d30249a 100644 (file)
@@ -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 {}
index 73dcacfe0b24b1e08f2a24b298f7a7883e4fbd2f..929ad012290600a744f02bb1b61c2b627eb9220d 100644 (file)
@@ -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)