Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,10 @@ PHP 8.4 UPGRADE NOTES
. posix_isatty now sets the error number when the file descriptor/stream argument
is invalid.

- Sockets:
. Parameter $backlog of socket_create_listen() now has a default value of SOMAXCONN.
Previously, it was 128.

- SPL:
. SplPriorityQueue::insert() and SplPriorityQueue::recoverFromCorruption()
now has a tentative return type of true
Expand Down
6 changes: 3 additions & 3 deletions ext/sockets/sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ ZEND_GET_MODULE(sockets)
static bool php_open_listen_sock(php_socket *sock, int port, int backlog) /* {{{ */
{
struct sockaddr_in la = {0};
struct hostent *hp;
struct hostent *hp;

#ifndef PHP_WIN32
if ((hp = php_network_gethostbyname("0.0.0.0")) == NULL) {
Expand Down Expand Up @@ -641,7 +641,7 @@ PHP_FUNCTION(socket_select)
PHP_FUNCTION(socket_create_listen)
{
php_socket *php_sock;
zend_long port, backlog = 128;
zend_long port, backlog = SOMAXCONN;

if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &port, &backlog) == FAILURE) {
RETURN_THROWS();
Expand Down Expand Up @@ -764,7 +764,7 @@ PHP_FUNCTION(socket_listen)
{
zval *arg1;
php_socket *php_sock;
zend_long backlog = 0;
zend_long backlog = 0;

if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|l", &arg1, socket_ce, &backlog) == FAILURE) {
RETURN_THROWS();
Expand Down
2 changes: 1 addition & 1 deletion ext/sockets/sockets.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -1885,7 +1885,7 @@ final class AddressInfo

function socket_select(?array &$read, ?array &$write, ?array &$except, ?int $seconds, int $microseconds = 0): int|false {}

function socket_create_listen(int $port, int $backlog = 128): Socket|false {}
function socket_create_listen(int $port, int $backlog = SOMAXCONN): Socket|false {}

function socket_accept(Socket $socket): Socket|false {}

Expand Down
4 changes: 2 additions & 2 deletions ext/sockets/sockets_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.