Skip to content
Merged
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: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ PHP NEWS
transmitted data can remain unacknowledged. (James Lucas)
. Added AF_UNSPEC support for sock_addrinfo_lookup() as a sole umbrella for
AF_INET* family only. (David Carlier)
. Fixed GH-20532 (socket_addrinfo_lookup gives the error code with a new optional
parameter). (David Carlier)

- SPL:
. DirectoryIterator key can now work better with filesystem supporting larger
Expand Down
25 changes: 25 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ PHP 8.6 UPGRADE NOTES
- Phar:
. Phar::mungServer() now supports reference values.

- Sockets:
. socket_addrinfo_lookup() now has an additional optional argument $error
when not null, and on failure, gives the error code (one of the EAI_*
constants).

- Zip:
. ZipArchive::extractTo now raises a TypeError for the
files argument if one or more of the entries is not
Expand Down Expand Up @@ -105,13 +110,33 @@ PHP 8.6 UPGRADE NOTES
- Hash:
. The bundled version of xxHash was upgraded to 0.8.2.

- mysqli
. Added new constant MYSQLI_OPT_COMPRESS.

========================================
10. New Global Constants
========================================

- Sockets:
. TCP_USER_TIMEOUT (Linux only).
. AF_UNSPEC.
. EAI_BADFLAGS.
. EAI_NONAME.
. EAI_AGAIN.
. EAI_FAIL.
. EAI_NODATA.
. EAI_FAMILY.
. EAI_SOCKTYPE.
. EAI_SERVICE.
. EAI_ADDRFAMILY.
. EAI_SYSTEM.
. EAI_OVERFLOW
. EAI_INPROGRESS.
. EAI_CANCELED.
. EAI_NOTCANCELED.
. EAI_ALLDONE.
. EAI_INTR.
. EAI_IDN_ENCODE.

========================================
11. Changes to INI File Handling
Expand Down
5 changes: 5 additions & 0 deletions ext/mysqli/mysqli.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
* @cvalue MYSQL_OPT_SSL_VERIFY_SERVER_CERT
*/
const MYSQLI_OPT_SSL_VERIFY_SERVER_CERT = UNKNOWN;
/**
* @var int
* @cvalue MYSQL_OPT_COMPRESS
*/
const MYSQLI_OPT_COMPRESS = UNKNOWN;

/**
* @var int
Expand Down
3 changes: 2 additions & 1 deletion ext/mysqli/mysqli_arginfo.h

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

1 change: 1 addition & 0 deletions ext/mysqli/tests/mysqli_constants.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ $expected_constants = array(
"MYSQLI_SERVER_QUERY_NO_GOOD_INDEX_USED"=> true,
"MYSQLI_SERVER_QUERY_NO_INDEX_USED" => true,
"MYSQLI_OPT_LOAD_DATA_LOCAL_DIR" => true,
"MYSQLI_OPT_COMPRESS" => true,
"MYSQLI_IS_MARIADB" => true,

"MYSQLI_TYPE_DECIMAL" => true,
Expand Down
2 changes: 2 additions & 0 deletions ext/opcache/jit/zend_jit_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -17199,6 +17199,7 @@ static int zend_jit_trace_handler(zend_jit_ctx *jit, const zend_op_array *op_arr
SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op2.var), IS_UNKNOWN, 1);
}
break;
case ZEND_FE_RESET_RW:
case ZEND_BIND_INIT_STATIC_OR_JMP:
if (opline->op1_type == IS_CV) {
old_info = STACK_INFO(stack, EX_VAR_TO_NUM(opline->op1.var));
Expand All @@ -17223,6 +17224,7 @@ static int zend_jit_trace_handler(zend_jit_ctx *jit, const zend_op_array *op_arr
SET_STACK_INFO(stack, EX_VAR_TO_NUM(opline->op2.var), old_info);
}
break;
case ZEND_FE_RESET_RW:
case ZEND_BIND_INIT_STATIC_OR_JMP:
if (opline->op1_type == IS_CV) {
SET_STACK_INFO(stack, EX_VAR_TO_NUM(opline->op1.var), old_info);
Expand Down
30 changes: 30 additions & 0 deletions ext/opcache/tests/jit/gh20818.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
--TEST--
GH-20818 (Segfault in Tracing JIT with Object Reference)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.jit=tracing
opcache.jit_buffer_size=1M
--FILE--
<?php

function process($data) {
foreach ($data as &$v) {}
}

$data = [
(object) ["" => 1],
(object) ["" => 1],
(object) [],
];

for ($i = 0; $i < 200; $i += 1) {
foreach ($data as $entry) {
process($entry);
}
}

echo "Done\n";
?>
--EXPECT--
Done
11 changes: 8 additions & 3 deletions ext/sockets/sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -2751,16 +2751,18 @@ PHP_FUNCTION(socket_addrinfo_lookup)
{
zend_string *service = NULL;
zend_string *hostname, *key;
zval *hint, *zhints = NULL;
zval *hint, *zhints = NULL, *error_code = NULL;
int ret = 0;

struct addrinfo hints, *result, *rp;
php_addrinfo *res;

ZEND_PARSE_PARAMETERS_START(1, 3)
ZEND_PARSE_PARAMETERS_START(1, 4)
Z_PARAM_STR(hostname)
Z_PARAM_OPTIONAL
Z_PARAM_STR_OR_NULL(service)
Z_PARAM_ARRAY(zhints)
Z_PARAM_ZVAL_OR_NULL(error_code)
ZEND_PARSE_PARAMETERS_END();

memset(&hints, 0, sizeof(hints));
Expand Down Expand Up @@ -2848,7 +2850,10 @@ PHP_FUNCTION(socket_addrinfo_lookup)
} ZEND_HASH_FOREACH_END();
}

if (getaddrinfo(ZSTR_VAL(hostname), service ? ZSTR_VAL(service) : NULL, &hints, &result) != 0) {
if ((ret = getaddrinfo(ZSTR_VAL(hostname), service ? ZSTR_VAL(service) : NULL, &hints, &result)) != 0) {
if (error_code) {
ZEND_TRY_ASSIGN_REF_LONG(error_code, ret);
}
RETURN_FALSE;
}

Expand Down
133 changes: 132 additions & 1 deletion ext/sockets/sockets.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -2067,6 +2067,136 @@
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;
#else
#ifdef EAI_FAMILY
/**
* @var int
* @cvalue EAI_FAMILY
*/
const EAI_ADDRFAMILY = UNKNOWN;
#else
#endif
#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 @@ -2187,9 +2317,10 @@ function socket_cmsg_space(int $level, int $type, int $num = 0): ?int {}

/**
* @return array<int, AddressInfo>|false
* @param int $error_code
* @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 = [], &$error_code = null): array|false {}

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

Expand Down
57 changes: 56 additions & 1 deletion ext/sockets/sockets_arginfo.h

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

Loading