Skip to content
Draft
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
2 changes: 1 addition & 1 deletion Zend/Optimizer/zend_func_infos.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ static const func_info_t func_infos[] = {
F1("session_cache_limiter", MAY_BE_STRING|MAY_BE_FALSE),
F1("socket_get_option", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_LONG|MAY_BE_FALSE),
FN("socket_export_stream", MAY_BE_RESOURCE|MAY_BE_FALSE),
F1("socket_addrinfo_lookup", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_FALSE),
F1("socket_addrinfo_lookup", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_LONG),
F1("socket_addrinfo_explain", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY),
FN("sodium_crypto_kx_client_session_keys", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
FN("sodium_crypto_kx_server_session_keys", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
Expand Down
5 changes: 3 additions & 2 deletions ext/sockets/sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -2731,6 +2731,7 @@ PHP_FUNCTION(socket_addrinfo_lookup)
size_t service_len = 0;
zend_string *hostname, *key;
zval *hint, *zhints = NULL;
int ret = 0;

struct addrinfo hints, *result, *rp;
php_addrinfo *res;
Expand Down Expand Up @@ -2825,8 +2826,8 @@ PHP_FUNCTION(socket_addrinfo_lookup)
} ZEND_HASH_FOREACH_END();
}

if (getaddrinfo(ZSTR_VAL(hostname), service, &hints, &result) != 0) {
RETURN_FALSE;
if ((ret = getaddrinfo(ZSTR_VAL(hostname), service, &hints, &result)) != 0) {
RETURN_LONG(ret);
}

array_init(return_value);
Expand Down
125 changes: 123 additions & 2 deletions ext/sockets/sockets.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -2053,6 +2053,127 @@
const SHUT_RDWR = UNKNOWN;
#endif


#ifdef EAI_BADFLAGS
/**
* @var int
* @cvalue EAI_BADFLAGS
*/
const EAI_BADFLAGS = UNKNOWN;
#endif
#ifdef EAI_NONAME
/**
* @var int
* @cvalue EAI_NONAME
*/
const EAI_NONAME = UNKNOWN;
#endif
#ifdef EAI_AGAIN
/**
* @var int
* @cvalue EAI_AGAIN
*/
const EAI_AGAIN = UNKNOWN;
#endif
#ifdef EAI_FAIL
/**
* @var int
* @cvalue EAI_FAIL
*/
const EAI_FAIL = UNKNOWN;
#endif
#ifdef EAI_NODATA
/**
* @var int
* @cvalue EAI_NODATA
*/
const EAI_NODATA = UNKNOWN;
#endif
#ifdef EAI_FAMILY
/**
* @var int
* @cvalue EAI_FAMILY
*/
const EAI_FAMILY = UNKNOWN;
#endif
#ifdef EAI_SOCKTYPE
/**
* @var int
* @cvalue EAI_SOCKTYPE
*/
const EAI_SOCKTYPE = UNKNOWN;
#endif
#ifdef EAI_SERVICE
/**
* @var int
* @cvalue EAI_SERVICE
*/
const EAI_SERVICE = UNKNOWN;
#endif
#ifdef EAI_ADDRFAMILY
/**
* @var int
* @cvalue EAI_ADDRFAMILY
*/
const EAI_ADDRFAMILY = UNKNOWN;
#endif
#ifdef EAI_SYSTEM
/**
* @var int
* @cvalue EAI_SYSTEM
*/
const EAI_SYSTEM = UNKNOWN;
#endif
#ifdef EAI_OVERFLOW
/**
* @var int
* @cvalue EAI_OVERFLOW
*/
const EAI_OVERFLOW = UNKNOWN;
#endif
#ifdef EAI_INPROGRESS
/**
* @var int
* @cvalue EAI_INPROGRESS
*/
const EAI_INPROGRESS = UNKNOWN;
#endif
#ifdef EAI_CANCELED
/**
* @var int
* @cvalue EAI_CANCELED
*/
const EAI_CANCELED = UNKNOWN;
#endif
#ifdef EAI_NOTCANCELED
/**
* @var int
* @cvalue EAI_NOTCANCELED
*/
const EAI_NOTCANCELED = UNKNOWN;
#endif
#ifdef EAI_ALLDONE
/**
* @var int
* @cvalue EAI_ALLDONE
*/
const EAI_ALLDONE = UNKNOWN;
#endif
#ifdef EAI_INTR
/**
* @var int
* @cvalue EAI_INTR
*/
const EAI_INTR = UNKNOWN;
#endif
#ifdef EAI_IDN_ENCODE
/**
* @var int
* @cvalue EAI_IDN_ENCODE
*/
const EAI_IDN_ENCODE = UNKNOWN;
#endif

/**
* @strict-properties
* @not-serializable
Expand Down Expand Up @@ -2172,10 +2293,10 @@ function socket_recvmsg(Socket $socket, array &$message, int $flags = 0): int|fa
function socket_cmsg_space(int $level, int $type, int $num = 0): ?int {}

/**
* @return array<int, AddressInfo>|false
* @return array<int, AddressInfo>|int
* @refcount 1
*/
function socket_addrinfo_lookup(string $host, ?string $service = null, array $hints = []): array|false {}
function socket_addrinfo_lookup(string $host, ?string $service = null, array $hints = []): array|int {}

function socket_addrinfo_connect(AddressInfo $address): Socket|false {}

Expand Down
55 changes: 53 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.