Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f38f745
Fix lazy proxy bailing __clone assertion
iluuu1994 Jan 19, 2026
005242f
Merge branch 'PHP-8.4' into PHP-8.5
iluuu1994 Jan 20, 2026
50d4f85
Merge branch 'PHP-8.5'
iluuu1994 Jan 20, 2026
6a21a41
[skip ci] Fix missing test attribution
iluuu1994 Jan 20, 2026
0e003a1
Merge branch 'PHP-8.4' into PHP-8.5
iluuu1994 Jan 20, 2026
51a3798
Merge branch 'PHP-8.5'
iluuu1994 Jan 20, 2026
57c62eb
Fix GH-20890: Segfault in zval_undefined_cv with non-simple property …
ndossche Jan 10, 2026
77c9c8c
Merge branch 'PHP-8.4' into PHP-8.5
ndossche Jan 20, 2026
c8952c7
Merge branch 'PHP-8.5'
ndossche Jan 20, 2026
32c0245
Revert "Fix GH-20890: Segfault in zval_undefined_cv with non-simple p…
ndossche Jan 20, 2026
fd5e451
Merge branch 'PHP-8.4' into PHP-8.5
ndossche Jan 20, 2026
9731f11
Merge branch 'PHP-8.5'
ndossche Jan 20, 2026
f957571
Remove dead code from zend_test internal execute handler
ndossche Jan 20, 2026
8776c7e
Extend zend_test internal function handler to also print leave (with …
ndossche Jan 20, 2026
6a4d0d9
Do nesting for internal execute hook
ndossche Jan 20, 2026
2d10ae2
ext/spl: move autoloading tests to subfolder
Girgias Jan 5, 2026
0cd648a
ext/spl: refactor spl_autoload()
Girgias Jan 5, 2026
8326ad0
ext/spl: refactor autoloading to use newer FCC APIs
Girgias Jan 5, 2026
ab2cd2d
ext/spl: inline HT_MOVE_TAIL_TO_HEAD macro
Girgias Jan 5, 2026
0f4fd2d
ext/spl: use ZPP specifier that doesn't free trampoline for spl_autol…
Girgias Jan 11, 2026
44d6417
ext/sockets: GH-20532 socket_addrinfo_lookup() sets EAI error code on…
devnexen Nov 19, 2025
8f55b08
ext/sqlite3: Sqlite3::openBlob() code path simplification. (#20969)
devnexen Jan 20, 2026
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
22 changes: 22 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 @@ -112,6 +117,23 @@ PHP 8.6 UPGRADE NOTES
- 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
2 changes: 2 additions & 0 deletions Zend/tests/attributes/nodiscard/007.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ zend_test_nodiscard();
?>
--EXPECTF--
<!-- internal enter NoDiscard::__construct() -->
<!-- internal leave NoDiscard::__construct() -->

Warning: The return value of function zend_test_nodiscard() should either be used or intentionally ignored by casting it as (void), custom message in %s on line %d
<!-- internal enter zend_test_nodiscard() -->
<!-- internal leave zend_test_nodiscard() -->
24 changes: 24 additions & 0 deletions Zend/tests/lazy_objects/gh20905.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--TEST--
GH-20905: Lazy proxy bailing __clone assertion
--CREDITS--
Viet Hoang Luu (@vi3tL0u1s)
--FILE--
<?php

function test() {
function f() {}
}

class A {
public $_;
public function __clone() {
test();
}
}

test();
clone (new ReflectionClass(A::class))->newLazyProxy(fn() => new A);

?>
--EXPECTF--
Fatal error: Cannot redeclare function f() (previously declared in %s:%d) in %s on line %d
3 changes: 1 addition & 2 deletions Zend/zend_lazy_objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,12 +744,11 @@ zend_object *zend_lazy_object_clone(zend_object *old_obj)
}
}

OBJ_EXTRA_FLAGS(new_proxy) = OBJ_EXTRA_FLAGS(old_obj);

zend_lazy_object_info *new_info = emalloc(sizeof(*info));
*new_info = *info;
new_info->u.instance = zend_objects_clone_obj(info->u.instance);

OBJ_EXTRA_FLAGS(new_proxy) = OBJ_EXTRA_FLAGS(old_obj);
zend_lazy_object_set_info(new_proxy, new_info);

return new_proxy;
Expand Down
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.

16 changes: 16 additions & 0 deletions ext/sockets/tests/gh20532.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--TEST--
GH-20562 - socket_addrinfo_lookup() returns error codes on resolution failures.
--EXTENSIONS--
sockets
--FILE--
<?php
$error_code = 0;
var_dump(socket_addrinfo_lookup(".whynot", null, [], $error_code) === false && $error_code === EAI_NONAME);
var_dump(socket_addrinfo_lookup("2001:db8::1", null, ['ai_family' => AF_INET], $error_code) === false && in_array($error_code, [EAI_FAMILY, EAI_ADDRFAMILY, EAI_NONAME, EAI_NODATA]));
var_dump(socket_addrinfo_lookup("example.com", "http", ['ai_socktype' => SOCK_RAW, 'ai_flags' => 2147483647], $error_code) === false && in_array($error_code, [EAI_SOCKTYPE, EAI_SERVICE, EAI_BADFLAGS, EAI_NONAME]));
?>
--EXPECT--
bool(true)
bool(true)
bool(true)

Loading
Loading