Skip to content

Commit 805aa06

Browse files
authored
Merge branch 'php:master' into true-async-api
2 parents a2f97ca + 2e0c011 commit 805aa06

28 files changed

+487
-128
lines changed

.github/scripts/setup-slapd.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ olcTLSCertificateKeyFile: /etc/ldap/ssl/server.key
7272
add: olcTLSVerifyClient
7373
olcTLSVerifyClient: never
7474
-
75+
add: olcTLSProtocolMin
76+
olcTLSProtocolMin: 3.3
77+
-
7578
add: olcAuthzRegexp
7679
olcAuthzRegexp: uid=usera,cn=digest-md5,cn=auth cn=usera,dc=my-domain,dc=com
7780
-

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ PHP NEWS
66
. socket_set_option for multicast context throws a ValueError
77
when the socket family is not of AF_INET/AF_INET6 family. (David Carlier)
88

9+
- URI:
10+
. Empty host handling is fixed. (Máté Kocsis)
11+
. Error handling of Uri\WhatWg\Url::withHost() is fixed when the input
12+
contains a port. Now, it triggers an exception; previously, the error
13+
was silently swallowed. (Máté Kocsis)
14+
915
17 Jul 2025, PHP 8.5.0alpha2
1016

1117
- Core:

UPGRADING

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ PHP 8.5 UPGRADE NOTES
188188
first redirect thus if there is any follow up redirect, it won't go
189189
any further. CURLFOLLOW_ALL is equivalent to setting CURLOPT_FOLLOWLOCATION
190190
to true.
191+
. Added support for CURLINFO_CONN_ID (libcurl >= 8.2.0) to the curl_getinfo()
192+
function. This constant allows retrieving the unique ID of the connection
193+
used by a cURL transfer. It is primarily useful when connection reuse or
194+
connection pooling logic is needed in PHP-level applications. When
195+
curl_getinfo() returns an array, this value is available as the "conn_id" key.
191196

192197
- DOM:
193198
. Added Dom\Element::$outerHTML.
@@ -425,6 +430,9 @@ PHP 8.5 UPGRADE NOTES
425430
. Added grapheme_levenshtein() function.
426431
RFC: https://wiki.php.net/rfc/grapheme_levenshtein
427432

433+
- Opcache:
434+
. Added opcache_is_script_cached_in_file_cache().
435+
428436
- Pdo\Sqlite:
429437
. Added support for Pdo\Sqlite::setAuthorizer(), which is the equivalent of
430438
SQLite3::setAuthorizer(). The only interface difference is that the
@@ -460,6 +468,13 @@ PHP 8.5 UPGRADE NOTES
460468
across multiple PHP requests.
461469
RFC: https://wiki.php.net/rfc/curl_share_persistence_improvement
462470

471+
- URI:
472+
. Uri\UriException, Uri\InvalidUriException, Uri\UriComparisonMode,
473+
Uri\Rfc3986\Uri, Uri\WhatWg\InvalidUrlException,
474+
Uri\WhatWg\UrlValidationErrorType, Uri\WhatWg\UrlValidationError,
475+
and Uri\WhatWg\Url are added.
476+
RFC: https://wiki.php.net/rfc/url_parsing_api
477+
463478
========================================
464479
8. Removed Extensions and SAPIs
465480
========================================
@@ -483,6 +498,11 @@ PHP 8.5 UPGRADE NOTES
483498
library that was separated from ext/dom for being reused among other
484499
extensions. The new extension is not directly exposed to userland.
485500

501+
- URI:
502+
. An always enabled uri extension is added that can be used for handling
503+
URIs and URLs according to RFC 3986 and WHATWG URL.
504+
RFC: https://wiki.php.net/rfc/url_parsing_api
505+
486506
- PCRE:
487507
. Upgraded to pcre2lib from 10.44 to 10.45.
488508

@@ -505,6 +525,7 @@ PHP 8.5 UPGRADE NOTES
505525
. CURLINFO_USED_PROXY.
506526
. CURLINFO_HTTPAUTH_USED.
507527
. CURLINFO_PROXYAUTH_USED.
528+
. CURLINFO_CONN_ID.
508529
. CURLOPT_INFILESIZE_LARGE.
509530
. CURLFOLLOW_ALL.
510531
. CURLFOLLOW_OBEYCODE.

Zend/zend_llist.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ ZEND_API void zend_llist_destroy(zend_llist *l)
121121
ZEND_API void zend_llist_clean(zend_llist *l)
122122
{
123123
zend_llist_destroy(l);
124-
l->head = l->tail = NULL;
125124
}
126125

127126

Zend/zend_objects.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ ZEND_API void ZEND_FASTCALL zend_objects_clone_members(zend_object *new_object,
264264
}
265265

266266
if (has_clone_method) {
267-
GC_ADDREF(new_object);
268267
zend_call_known_instance_method_with_0_params(new_object->ce->clone, new_object, NULL);
269268

270269
if (ZEND_CLASS_HAS_READONLY_PROPS(new_object->ce)) {
@@ -274,8 +273,6 @@ ZEND_API void ZEND_FASTCALL zend_objects_clone_members(zend_object *new_object,
274273
Z_PROP_FLAG_P(prop) &= ~IS_PROP_REINITABLE;
275274
}
276275
}
277-
278-
OBJ_RELEASE(new_object);
279276
}
280277
}
281278

ext/curl/config.m4

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ if test "$PHP_CURL" != "no"; then
1515
AC_MSG_RESULT([$CURL_SSL])
1616

1717
AS_IF([test "x$PHP_THREAD_SAFETY" = xyes && test "x$CURL_SSL" = xyes],
18-
[AC_CACHE_CHECK([whether libcurl is linked against old OpenSSL < 1.1],
19-
[php_cv_lib_curl_ssl], [
18+
[AC_CACHE_CHECK([whether libcurl is linked against a supported OpenSSL version],
19+
[php_cv_lib_curl_ssl_supported], [
2020
save_LIBS=$LIBS
2121
save_CFLAGS=$CFLAGS
2222
LIBS="$LIBS $CURL_SHARED_LIBADD"
@@ -34,17 +34,14 @@ if test "$PHP_CURL" != "no"; then
3434
3535
while(*ptr == ' ') ++ptr;
3636
int major, minor;
37-
if (sscanf(ptr, "OpenSSL/%d", &major) == 1) {
38-
if (major >= 3) {
39-
/* OpenSSL version 3 or later */
40-
return 4;
41-
}
42-
}
4337
if (sscanf(ptr, "OpenSSL/%d.%d", &major, &minor) == 2) {
44-
if (major > 1 || (major == 1 && minor >= 1)) {
45-
/* OpenSSL version 1.1 or later */
38+
/* Check for 1.1.1+ (including 1.1.1a, 1.1.1b, etc.) */
39+
if ((major > 1) || (major == 1 && minor == 1 && strncmp(ptr + 12, "1", 1) == 0)) {
40+
/* OpenSSL 1.1.1+ - supported */
4641
return 3;
4742
}
43+
/* OpenSSL 1.1.0 and earlier - unsupported */
44+
return 0;
4845
}
4946
if (strncasecmp(ptr, "OpenSSL", sizeof("OpenSSL")-1) == 0) {
5047
/* Old OpenSSL version */
@@ -56,18 +53,15 @@ if test "$PHP_CURL" != "no"; then
5653
/* No SSL support */
5754
return 1;
5855
])],
59-
[php_cv_lib_curl_ssl=yes],
60-
[php_cv_lib_curl_ssl=no],
61-
[php_cv_lib_curl_ssl=no])
56+
[php_cv_lib_curl_ssl_supported=no],
57+
[php_cv_lib_curl_ssl_supported=yes],
58+
[php_cv_lib_curl_ssl_supported=yes])
6259
LIBS=$save_LIBS
6360
CFLAGS=$save_CFLAGS
6461
])
6562
66-
AS_VAR_IF([php_cv_lib_curl_ssl], [yes], [
67-
AC_DEFINE([HAVE_CURL_OLD_OPENSSL], [1],
68-
[Define to 1 if libcurl is linked against old OpenSSL < 1.1.])
69-
PHP_SETUP_OPENSSL([CURL_SHARED_LIBADD],
70-
[AC_CHECK_HEADERS([openssl/crypto.h])])
63+
AS_VAR_IF([php_cv_lib_curl_ssl_supported], [no], [
64+
AC_MSG_ERROR([libcurl is linked against an unsupported OpenSSL version. OpenSSL 1.1.1 or later is required.])
7165
])
7266
])
7367

ext/curl/curl.stub.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3103,6 +3103,13 @@
31033103
*/
31043104
const CURLINFO_POSTTRANSFER_TIME_T = UNKNOWN;
31053105
#endif
3106+
#if LIBCURL_VERSION_NUM >= 0x080200 /* Available since 8.2.0 */
3107+
/**
3108+
* @var int
3109+
* @cvalue CURLINFO_CONN_ID
3110+
*/
3111+
const CURLINFO_CONN_ID = UNKNOWN;
3112+
#endif
31063113
/**
31073114
* @var int
31083115
* @cvalue CURLOPT_DISALLOW_USERNAME_IN_URL

ext/curl/curl_arginfo.h

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/curl/interface.c

Lines changed: 5 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,6 @@
3939
#define HttpPost curl_httppost
4040
#endif
4141

42-
/* {{{ cruft for thread safe SSL crypto locks */
43-
#if defined(ZTS) && defined(HAVE_CURL_OLD_OPENSSL)
44-
# if defined(HAVE_OPENSSL_CRYPTO_H)
45-
# define PHP_CURL_NEED_OPENSSL_TSL
46-
# include <openssl/crypto.h>
47-
# else
48-
# warning \
49-
"libcurl was compiled with OpenSSL support, but configure could not find " \
50-
"openssl/crypto.h; thus no SSL crypto locking callbacks will be set, which may " \
51-
"cause random crashes on SSL requests"
52-
# endif
53-
#endif /* ZTS && HAVE_CURL_OLD_OPENSSL */
54-
/* }}} */
55-
5642
#include "zend_smart_str.h"
5743
#include "ext/standard/info.h"
5844
#include "ext/standard/file.h"
@@ -70,27 +56,6 @@
7056

7157
ZEND_DECLARE_MODULE_GLOBALS(curl)
7258

73-
#ifdef PHP_CURL_NEED_OPENSSL_TSL /* {{{ */
74-
static MUTEX_T *php_curl_openssl_tsl = NULL;
75-
76-
/* Locking callbacks are no longer used since OpenSSL 1.1. Mark the functions as unused to
77-
* avoid warnings due to this. */
78-
static ZEND_ATTRIBUTE_UNUSED void php_curl_ssl_lock(int mode, int n, const char * file, int line)
79-
{
80-
if (mode & CRYPTO_LOCK) {
81-
tsrm_mutex_lock(php_curl_openssl_tsl[n]);
82-
} else {
83-
tsrm_mutex_unlock(php_curl_openssl_tsl[n]);
84-
}
85-
}
86-
87-
static ZEND_ATTRIBUTE_UNUSED unsigned long php_curl_ssl_id(void)
88-
{
89-
return (unsigned long) tsrm_thread_id();
90-
}
91-
#endif
92-
/* }}} */
93-
9459
#define CAAL(s, v) add_assoc_long_ex(return_value, s, sizeof(s) - 1, (zend_long) v);
9560
#define CAAD(s, v) add_assoc_double_ex(return_value, s, sizeof(s) - 1, (double) v);
9661
#define CAAS(s, v) add_assoc_string_ex(return_value, s, sizeof(s) - 1, (char *) (v ? v : ""));
@@ -389,24 +354,6 @@ PHP_MINIT_FUNCTION(curl)
389354

390355
register_curl_symbols(module_number);
391356

392-
#ifdef PHP_CURL_NEED_OPENSSL_TSL
393-
if (!CRYPTO_get_id_callback()) {
394-
int i, c = CRYPTO_num_locks();
395-
396-
php_curl_openssl_tsl = malloc(c * sizeof(MUTEX_T));
397-
if (!php_curl_openssl_tsl) {
398-
return FAILURE;
399-
}
400-
401-
for (i = 0; i < c; ++i) {
402-
php_curl_openssl_tsl[i] = tsrm_mutex_alloc();
403-
}
404-
405-
CRYPTO_set_id_callback(php_curl_ssl_id);
406-
CRYPTO_set_locking_callback(php_curl_ssl_lock);
407-
}
408-
#endif
409-
410357
if (curl_global_init(CURL_GLOBAL_DEFAULT) != CURLE_OK) {
411358
return FAILURE;
412359
}
@@ -568,21 +515,6 @@ zend_result curl_cast_object(zend_object *obj, zval *result, int type)
568515
PHP_MSHUTDOWN_FUNCTION(curl)
569516
{
570517
curl_global_cleanup();
571-
#ifdef PHP_CURL_NEED_OPENSSL_TSL
572-
if (php_curl_openssl_tsl) {
573-
int i, c = CRYPTO_num_locks();
574-
575-
CRYPTO_set_id_callback(NULL);
576-
CRYPTO_set_locking_callback(NULL);
577-
578-
for (i = 0; i < c; ++i) {
579-
tsrm_mutex_free(php_curl_openssl_tsl[i]);
580-
}
581-
582-
free(php_curl_openssl_tsl);
583-
php_curl_openssl_tsl = NULL;
584-
}
585-
#endif
586518
UNREGISTER_INI_ENTRIES();
587519
return SUCCESS;
588520
}
@@ -2690,6 +2622,11 @@ PHP_FUNCTION(curl_getinfo)
26902622
if (curl_easy_getinfo(ch->cp, CURLINFO_PROXYAUTH_USED, &l_code) == CURLE_OK) {
26912623
CAAL("proxyauth_used", l_code);
26922624
}
2625+
#endif
2626+
#if LIBCURL_VERSION_NUM >= 0x080200 /* Available since 8.2.0 */
2627+
if (curl_easy_getinfo(ch->cp, CURLINFO_CONN_ID , &co) == CURLE_OK) {
2628+
CAAL("conn_id", co);
2629+
}
26932630
#endif
26942631
} else {
26952632
switch (option) {

0 commit comments

Comments
 (0)