Skip to content

Commit 3dc6365

Browse files
authored
Merge branch 'php:master' into my-master
2 parents 36e702c + 2645663 commit 3dc6365

273 files changed

Lines changed: 6430 additions & 2540 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/apt-x32/action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ runs:
3535
libssl-dev:i386 \
3636
libwebp-dev:i386 \
3737
libxml2-dev:i386 \
38-
libxml2-dev:i386 \
3938
libxpm-dev:i386 \
4039
libxslt1-dev:i386 \
4140
firebird-dev:i386 \

.github/actions/freebsd/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ runs:
99
- name: FreeBSD
1010
uses: vmactions/freebsd-vm@v1
1111
with:
12-
release: '13.3'
12+
release: '13.5'
1313
usesh: true
1414
copyback: false
1515
# Temporarily disable sqlite, as FreeBSD ships it with disabled double quotes. We'll need to fix our tests.

.github/labeler.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,6 @@
469469
- 'ext/pdo/php_pdo.h'
470470
- 'ext/pdo/php_pdo_driver.h'
471471
- 'ext/pdo/php_pdo_error.h'
472-
- 'ext/phar/php_phar.h'
473472
- 'ext/random/php_random.h'
474473
- 'ext/random/php_random_csprng.h'
475474
- 'ext/random/php_random_uint128.h'

.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: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,60 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3-
?? ??? ????, PHP 8.5.0alpha2
3+
?? ??? ????, PHP 8.5.0alpha3
4+
5+
- Core:
6+
. Add clone-with support to the clone() function. (timwolla, edorian)
7+
. Fix support for non-userland stream notifiers. (timwolla)
8+
. Added PHP_BUILD_PROVIDER constant. (timwolla)
9+
10+
- Curl:
11+
. Add support for CURLINFO_CONN_ID in curl_getinfo() (thecaliskan)
12+
. Add support for CURLINFO_QUEUE_TIME_T in curl_getinfo() (thecaliskan)
13+
14+
- Reflection:
15+
. Fixed bug GH-19187 (ReflectionNamedType::getName() prints nullable type when
16+
retrieved from ReflectionProperty::getSettableType()). (ilutov)
17+
18+
- Session:
19+
. Fixed GH-19197: build broken with ZEND_STRL usage with memcpy
20+
when implemented as macro. (David Carlier)
21+
22+
- Sockets:
23+
. socket_set_option for multicast context throws a ValueError
24+
when the socket family is not of AF_INET/AF_INET6 family. (David Carlier)
25+
26+
- Standard:
27+
. Add HEIF/HEIC support to getimagesize. (Benstone Zhang)
28+
. Implement #71517 (Implement SVG support for getimagesize() and friends).
29+
(nielsdos)
30+
. Optimized PHP html_entity_decode function. (Artem Ukrainskiy)
31+
. Minor optimization to array_chunk(). (nielsdos)
32+
33+
- URI:
34+
. Empty host handling is fixed. (Máté Kocsis)
35+
. Error handling of Uri\WhatWg\Url::withHost() is fixed when the input
36+
contains a port. Now, it triggers an exception; previously, the error
37+
was silently swallowed. (Máté Kocsis)
38+
. Support empty URIs with Uri\Rfc3986\Uri. (timwolla)
39+
40+
17 Jul 2025, PHP 8.5.0alpha2
41+
42+
- Core:
43+
. Fix OSS-Fuzz #427814452 (pipe compilation fails with assert).
44+
(nielsdos, ilutov)
45+
46+
- DOM:
47+
. Make cloning DOM node lists, maps, and collections fail. (nielsdos)
48+
. Added Dom\Element::getElementsByClassName(). (nielsdos)
49+
50+
- PDO_ODBC
51+
. Fetch larger block sizes and better handle SQL_NO_TOTAL when calling
52+
SQLGetData. (Calvin Buckley, Saki Takamachi)
453

554
- Standard:
655
. Optimized pack(). (nielsdos, divinity76)
56+
. Fixed bug GH-19070 (setlocale($type, NULL) should not be deprecated).
57+
(nielsdos)
758

859
- URI:
960
. Return the singleton UrlValidationErrorType instances from Uri\WhatWg\Url
@@ -70,6 +121,8 @@ PHP NEWS
70121
(DanielEScherzer)
71122
. Do not use RTLD_DEEPBIND if dlmopen is available. (Daniil Gentili)
72123
. Make `clone()` a function. (timwolla, edorian)
124+
. Fixed bug GH-19081 (Wrong lineno in property error with constructor property
125+
promotion). (ilutov)
73126

74127
- Curl:
75128
. Added curl_multi_get_handles(). (timwolla)
@@ -142,6 +195,11 @@ PHP NEWS
142195
. Log a warning when opcache lock file permissions could not be changed.
143196
(Taavi Eomäe)
144197

198+
- OpenSSL:
199+
. Added openssl.libctx INI that allows to select the OpenSSL library context
200+
type and convert verious parts of the extension to use the custom libctx.
201+
(Jakub Zelenka)
202+
145203
- Output:
146204
. Fixed calculation of aligned buffer size. (cmb)
147205

@@ -197,6 +255,7 @@ PHP NEWS
197255
zval for uninitialized typed properties). (nielsdos)
198256
. Fixed bug GH-15766 (ReflectionClass::toString() should have better output
199257
for enums). (DanielEScherzer)
258+
. Added ReflectionProperty::getMangledName() method. (alexandre-daubois)
200259

201260
- Session:
202261
. session_start() throws a ValueError on option argument if not a hashmap

UPGRADING

Lines changed: 76 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ PHP 8.5 UPGRADE NOTES
4545
change, but should more closely match user expectations, demonstrated by
4646
GH-15753 and GH-16198.
4747

48+
- DOM:
49+
. Cloning a DOMNamedNodeMap, DOMNodeList, Dom\NamedNodeMap, Dom\NodeList,
50+
Dom\HTMLCollection, and Dom\DtdNamedNodeMap now fails.
51+
This never actually resulted in a working object,
52+
so the impact should actually be zero.
53+
4854
- FileInfo:
4955
. finfo_file() and finfo::file() now throws a ValueError instead of a
5056
TypeError when $filename contains nul bytes.
@@ -182,6 +188,16 @@ PHP 8.5 UPGRADE NOTES
182188
first redirect thus if there is any follow up redirect, it won't go
183189
any further. CURLFOLLOW_ALL is equivalent to setting CURLOPT_FOLLOWLOCATION
184190
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.
196+
. Added support for CURLINFO_QUEUE_TIME_T (libcurl >= 8.6.0) to the curl_getinfo()
197+
function. This constant allows retrieving the time (in microseconds) that the
198+
request spent in libcurl’s connection queue before it was sent.
199+
This value can also be retrieved by passing CURLINFO_QUEUE_TIME_T to the
200+
curl_getinfo() $option parameter.
185201

186202
- DOM:
187203
. Added Dom\Element::$outerHTML.
@@ -228,6 +244,16 @@ PHP 8.5 UPGRADE NOTES
228244
process was terminated unexpectedly. In such cases, a warning is emitted
229245
and the function returns false. Previously, these errors were silently
230246
ignored. This change affects only the sendmail transport.
247+
. getimagesize() now supports HEIF/HEIC images.
248+
249+
- Standard:
250+
. getimagesize() now supports SVG images when ext-libxml is also loaded.
251+
Similarly, image_type_to_extension() and image_type_to_extension()
252+
now also handle IMAGETYPE_SVG.
253+
. The array returned by getimagesize() now has two additional entries:
254+
"width_unit" and "height_unit" to indicate in which units the dimensions
255+
are expressed. These units are px by default. They are not necessarily
256+
the same (just to give one example: one may be cm and the other may be px).
231257

232258
- XSL:
233259
. The $namespace argument of XSLTProcessor::getParameter(),
@@ -265,6 +291,12 @@ PHP 8.5 UPGRADE NOTES
265291
it is visible; if there are nested output handlers the next one will still
266292
be used.
267293
RFC: https://wiki.php.net/rfc/deprecations_php_8_4
294+
. Trying to produce output (e.g. with `echo`) within a user output handler
295+
is deprecated. The deprecation warning will bypass the handler producing the
296+
output to ensure it is visible; if there are nested output handlers the next
297+
one will still be used. If a user output handler returns a non-string and
298+
produces output, the warning about producing an output is emitted first.
299+
RFC: https://wiki.php.net/rfc/deprecations_php_8_4
268300

269301
- Hash:
270302
. The MHASH_* constants have been deprecated. These have been overlooked
@@ -349,7 +381,7 @@ PHP 8.5 UPGRADE NOTES
349381
- Sockets:
350382
. socket_create_listen, socket_bind and socket_sendto throw a
351383
ValueError if the port is lower than 0 or greater than 65535,
352-
also if any of the hints array entry is indexes numerically.
384+
and also if any of the hints array entries are indexed numerically.
353385
. socket_addrinfo_lookup throws a TypeError if any of the hints
354386
values cannot be cast to int and can throw a ValueError if
355387
any of these values overflow.
@@ -359,6 +391,8 @@ PHP 8.5 UPGRADE NOTES
359391
. socket_create/socket_bind can create AF_PACKET family sockets.
360392
. socket_getsockname gets the interface index and its string
361393
representation with AF_PACKET socket.
394+
. socket_set_option with multicast context throws a ValueError
395+
when the created socket is not of AF_INET/AF_INET6 family.
362396

363397
- Tidy:
364398
. tidy::__construct/parseFile/parseString now throws a ValueError
@@ -384,8 +418,10 @@ PHP 8.5 UPGRADE NOTES
384418
. get_exception_handler() allows retrieving the current user-defined exception
385419
handler function.
386420
RFC: https://wiki.php.net/rfc/get-error-exception-handler
387-
. The clone language construct is now a function.
421+
. The clone language construct is now a function and supports reassigning
422+
(readonly) properties during cloning via the new $withProperties parameter.
388423
RFC: https://wiki.php.net/rfc/clone_with_v2
424+
. Added Closure::getCurrent() to receive currently executing closure.
389425

390426
- Curl:
391427
. curl_multi_get_handles() allows retrieving all CurlHandles current
@@ -396,6 +432,7 @@ PHP 8.5 UPGRADE NOTES
396432
RFC: https://wiki.php.net/rfc/curl_share_persistence_improvement
397433

398434
- DOM:
435+
. Added Dom\Element::getElementsByClassName().
399436
. Added Dom\Element::insertAdjacentHTML().
400437

401438
- Enchant:
@@ -410,6 +447,9 @@ PHP 8.5 UPGRADE NOTES
410447
. Added grapheme_levenshtein() function.
411448
RFC: https://wiki.php.net/rfc/grapheme_levenshtein
412449

450+
- Opcache:
451+
. Added opcache_is_script_cached_in_file_cache().
452+
413453
- Pdo\Sqlite:
414454
. Added support for Pdo\Sqlite::setAuthorizer(), which is the equivalent of
415455
SQLite3::setAuthorizer(). The only interface difference is that the
@@ -427,6 +467,7 @@ PHP 8.5 UPGRADE NOTES
427467
ReflectionConstant::getExtensionName() were introduced.
428468
. ReflectionConstant::getAttributes() was introduced.
429469
RFC: https://wiki.php.net/rfc/attributes-on-constants
470+
. ReflectionProperty::getMangledName() was introduced.
430471

431472
- Sqlite:
432473
. Sqlite3Stmt::busy to check if a statement had been fetched
@@ -445,6 +486,13 @@ PHP 8.5 UPGRADE NOTES
445486
across multiple PHP requests.
446487
RFC: https://wiki.php.net/rfc/curl_share_persistence_improvement
447488

489+
- URI:
490+
. Uri\UriException, Uri\InvalidUriException, Uri\UriComparisonMode,
491+
Uri\Rfc3986\Uri, Uri\WhatWg\InvalidUrlException,
492+
Uri\WhatWg\UrlValidationErrorType, Uri\WhatWg\UrlValidationError,
493+
and Uri\WhatWg\Url are added.
494+
RFC: https://wiki.php.net/rfc/url_parsing_api
495+
448496
========================================
449497
8. Removed Extensions and SAPIs
450498
========================================
@@ -459,7 +507,7 @@ PHP 8.5 UPGRADE NOTES
459507
CURLFOLLOW_FIRSTONLY.
460508

461509
- Fileinfo:
462-
. Upgraded to file 5.46.
510+
. Upgraded file from 5.45 to 5.46.
463511
. The return type of finfo_close() has been changed to true, rather
464512
than bool.
465513

@@ -468,8 +516,13 @@ PHP 8.5 UPGRADE NOTES
468516
library that was separated from ext/dom for being reused among other
469517
extensions. The new extension is not directly exposed to userland.
470518

519+
- URI:
520+
. An always enabled uri extension is added that can be used for handling
521+
URIs and URLs according to RFC 3986 and WHATWG URL.
522+
RFC: https://wiki.php.net/rfc/url_parsing_api
523+
471524
- PCRE:
472-
. Upgraded to pcre2lib from 10.44 to 10.45.
525+
. Upgraded pcre2lib from 10.44 to 10.45.
473526

474527
- PDO_Sqlite:
475528
. Increased minimum release version support from 3.7.7 to 3.7.17.
@@ -485,11 +538,14 @@ PHP 8.5 UPGRADE NOTES
485538

486539
- Core:
487540
. PHP_BUILD_DATE.
541+
. PHP_BUILD_PROVIDER.
488542

489543
- Curl:
490544
. CURLINFO_USED_PROXY.
491545
. CURLINFO_HTTPAUTH_USED.
492546
. CURLINFO_PROXYAUTH_USED.
547+
. CURLINFO_CONN_ID.
548+
. CURLINFO_QUEUE_TIME_T.
493549
. CURLOPT_INFILESIZE_LARGE.
494550
. CURLFOLLOW_ALL.
495551
. CURLFOLLOW_OBEYCODE.
@@ -522,6 +578,9 @@ PHP 8.5 UPGRADE NOTES
522578
. T_VOID_CAST.
523579
. T_PIPE.
524580

581+
- Standard:
582+
. IMAGETYPE_SVG when libxml is loaded.
583+
525584
========================================
526585
11. Changes to INI File Handling
527586
========================================
@@ -545,6 +604,11 @@ PHP 8.5 UPGRADE NOTES
545604
from being a multiple of loop iteration counts.
546605
It is recommended that this parameter is set to a prime number.
547606

607+
- OpenSSL:
608+
Added openssl.libctx to select the OpenSSL library context type. Either
609+
custom libctx for each thread can be used or a single global (default)
610+
libctx is used.
611+
548612
========================================
549613
12. Windows Support
550614
========================================
@@ -593,6 +657,13 @@ PHP 8.5 UPGRADE NOTES
593657
. The `-z` or `--zend-extension` option has been removed as it was
594658
non-functional. Use `-d zend_extension=<path>` instead.
595659

660+
- PDO_ODBC
661+
. The fetch behaviour for larger columns has been changed. Rather than
662+
fetching 256 byte blocks, PDO_ODBC will try to fetch a larger block size;
663+
currently, this is the page size minus string overhead. Drivers that
664+
return SQL_NO_TOTAL in SQLGetData are also better handled as well.
665+
This should improve compatibility and performance. See GH-10809, GH-10733.
666+
596667
========================================
597668
14. Performance Improvements
598669
========================================
@@ -627,6 +698,7 @@ PHP 8.5 UPGRADE NOTES
627698
. Improved unpack() performance with nameless repetitions by avoiding
628699
creating temporary strings and reparsing them.
629700
. Improved pack() performance.
701+
. Minor improvements in array_chunk() performance.
630702

631703
- XMLReader:
632704
. Improved property access performance.

UPGRADING.INTERNALS

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ PHP 8.5 INTERNALS UPGRADE NOTES
2323
the user side when requiring libphp.so, by using dlmopen with LM_ID_NEWLM
2424
instead of dlopen.
2525
RTLD_DEEPBIND is still enabled when the Apache SAPI is in use.
26+
. The ptr field of the php_stream_notifier struct is now a void* instead
27+
of a zval. If the zval was used to store IS_PTR values only, the
28+
extra layer of indirection can be removed. In other cases a zval can
29+
be heap-allocated and stored in the pointer as a minimal change to keep
30+
compatibility.
2631

2732
- Zend
2833
. Added zend_safe_assign_to_variable_noref() function to safely assign
@@ -76,7 +81,7 @@ PHP 8.5 INTERNALS UPGRADE NOTES
7681
. Preprocessor macro SIZEOF_INTMAX_T has been removed.
7782

7883
- Windows build system changes
79-
. SAPI() and ADD_SOURCES() now suport the optional `duplicate_sources`
84+
. SAPI() and ADD_SOURCES() now support the optional `duplicate_sources`
8085
parameter. If truthy, no rules to build the object files are generated.
8186
This allows to build additional variants of SAPIs (e.g. a DLL and EXE)
8287
without duplicate build rules. It is up to the SAPI maintainers to ensure
@@ -129,6 +134,10 @@ PHP 8.5 INTERNALS UPGRADE NOTES
129134
. The php_std_date() function has been removed. Use php_format_date() with
130135
the "D, d M Y H:i:s \\G\\M\\T" format instead.
131136
. Added php_url_encode_to_smart_str() to encode a URL to a smart_str buffer.
137+
. The functionality of getimagesize(), image_type_to_mime_type(),
138+
and image_type_to_extension() is now extensible using the internal APIs
139+
php_image_register_handler() and php_image_unregister_handler() in
140+
php_image.h.
132141

133142
========================
134143
4. OpCode changes

Zend/Optimizer/zend_func_infos.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ static const func_info_t func_infos[] = {
131131
F1("imagecreatefromgd", MAY_BE_OBJECT|MAY_BE_FALSE),
132132
F1("imagecreatefromgd2", MAY_BE_OBJECT|MAY_BE_FALSE),
133133
F1("imagecreatefromgd2part", MAY_BE_OBJECT|MAY_BE_FALSE),
134-
#if defined(HAVE_GD_BMP)
135134
F1("imagecreatefrombmp", MAY_BE_OBJECT|MAY_BE_FALSE),
136-
#endif
137135
F1("imagecolorsforindex", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG),
138136
F1("imagegetclip", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_LONG),
139137
#if defined(HAVE_GD_FREETYPE)

Zend/Zend.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ AC_CHECK_FUNCS(m4_normalize([
149149
pthread_get_stackaddr_np
150150
pthread_getattr_np
151151
pthread_stackseg_np
152+
strnlen
152153
]))
153154
154155
AC_CHECK_DECL([clock_gettime_nsec_np],

0 commit comments

Comments
 (0)