Skip to content

Commit 582831b

Browse files
authored
Merge branch 'php:master' into master
2 parents abdad17 + 7c1e461 commit 582831b

File tree

177 files changed

+3802
-1069
lines changed

Some content is hidden

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

177 files changed

+3802
-1069
lines changed

.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/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
-

.github/workflows/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ jobs:
198198
fail-fast: false
199199
matrix:
200200
include:
201-
- os: 14
201+
- os: 15
202202
arch: ARM64
203203
name: MACOS_${{ matrix.arch }}_DEBUG_NTS
204204
runs-on: macos-${{ matrix.os }}

NEWS

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,48 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.5.0alpha3
44

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+
- OpenSSL:
15+
. Add $digest_algo parameter to openssl_public_encrypt() and
16+
openssl_private_decrypt() functions. (Jakub Zelenka)
17+
18+
- Reflection:
19+
. Fixed bug GH-19187 (ReflectionNamedType::getName() prints nullable type when
20+
retrieved from ReflectionProperty::getSettableType()). (ilutov)
21+
22+
- Session:
23+
. Fixed GH-19197: build broken with ZEND_STRL usage with memcpy
24+
when implemented as macro. (David Carlier)
25+
26+
- Soap:
27+
. Fixed bug GH-19226 (Segfault when spawning new thread in soap extension).
28+
(Florian Engelhardt)
29+
530
- Sockets:
631
. socket_set_option for multicast context throws a ValueError
732
when the socket family is not of AF_INET/AF_INET6 family. (David Carlier)
833

34+
- Standard:
35+
. Add HEIF/HEIC support to getimagesize. (Benstone Zhang)
36+
. Implement #71517 (Implement SVG support for getimagesize() and friends).
37+
(nielsdos)
38+
. Optimized PHP html_entity_decode function. (Artem Ukrainskiy)
39+
. Minor optimization to array_chunk(). (nielsdos)
40+
941
- URI:
1042
. Empty host handling is fixed. (Máté Kocsis)
1143
. Error handling of Uri\WhatWg\Url::withHost() is fixed when the input
1244
contains a port. Now, it triggers an exception; previously, the error
1345
was silently swallowed. (Máté Kocsis)
46+
. Support empty URIs with Uri\Rfc3986\Uri. (timwolla)
1447

1548
17 Jul 2025, PHP 8.5.0alpha2
1649

@@ -230,6 +263,7 @@ PHP NEWS
230263
zval for uninitialized typed properties). (nielsdos)
231264
. Fixed bug GH-15766 (ReflectionClass::toString() should have better output
232265
for enums). (DanielEScherzer)
266+
. Added ReflectionProperty::getMangledName() method. (alexandre-daubois)
233267

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

UPGRADING

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ PHP 8.5 UPGRADE NOTES
193193
used by a cURL transfer. It is primarily useful when connection reuse or
194194
connection pooling logic is needed in PHP-level applications. When
195195
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.
196201

197202
- DOM:
198203
. Added Dom\Element::$outerHTML.
@@ -239,6 +244,16 @@ PHP 8.5 UPGRADE NOTES
239244
process was terminated unexpectedly. In such cases, a warning is emitted
240245
and the function returns false. Previously, these errors were silently
241246
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).
242257

243258
- XSL:
244259
. The $namespace argument of XSLTProcessor::getParameter(),
@@ -312,6 +327,10 @@ PHP 8.5 UPGRADE NOTES
312327
- libxml:
313328
. libxml_set_external_entity_loader() now has a formal return type of true.
314329

330+
- OpenSSL:
331+
. openssl_public_encrypt() and openssl_private_decrypt() have new parameter
332+
$digest_algo that allows specifying hash digest algorith for OEAP padding.
333+
315334
- PCNTL:
316335
. pcntl_exec() now has a formal return type of false.
317336
. pcntl_waitid() takes an additional resource_usage argument to
@@ -366,7 +385,7 @@ PHP 8.5 UPGRADE NOTES
366385
- Sockets:
367386
. socket_create_listen, socket_bind and socket_sendto throw a
368387
ValueError if the port is lower than 0 or greater than 65535,
369-
also if any of the hints array entry is indexes numerically.
388+
and also if any of the hints array entries are indexed numerically.
370389
. socket_addrinfo_lookup throws a TypeError if any of the hints
371390
values cannot be cast to int and can throw a ValueError if
372391
any of these values overflow.
@@ -403,8 +422,10 @@ PHP 8.5 UPGRADE NOTES
403422
. get_exception_handler() allows retrieving the current user-defined exception
404423
handler function.
405424
RFC: https://wiki.php.net/rfc/get-error-exception-handler
406-
. The clone language construct is now a function.
425+
. The clone language construct is now a function and supports reassigning
426+
(readonly) properties during cloning via the new $withProperties parameter.
407427
RFC: https://wiki.php.net/rfc/clone_with_v2
428+
. Added Closure::getCurrent() to receive currently executing closure.
408429

409430
- Curl:
410431
. curl_multi_get_handles() allows retrieving all CurlHandles current
@@ -430,6 +451,9 @@ PHP 8.5 UPGRADE NOTES
430451
. Added grapheme_levenshtein() function.
431452
RFC: https://wiki.php.net/rfc/grapheme_levenshtein
432453

454+
- Opcache:
455+
. Added opcache_is_script_cached_in_file_cache().
456+
433457
- Pdo\Sqlite:
434458
. Added support for Pdo\Sqlite::setAuthorizer(), which is the equivalent of
435459
SQLite3::setAuthorizer(). The only interface difference is that the
@@ -447,6 +471,7 @@ PHP 8.5 UPGRADE NOTES
447471
ReflectionConstant::getExtensionName() were introduced.
448472
. ReflectionConstant::getAttributes() was introduced.
449473
RFC: https://wiki.php.net/rfc/attributes-on-constants
474+
. ReflectionProperty::getMangledName() was introduced.
450475

451476
- Sqlite:
452477
. Sqlite3Stmt::busy to check if a statement had been fetched
@@ -486,7 +511,7 @@ PHP 8.5 UPGRADE NOTES
486511
CURLFOLLOW_FIRSTONLY.
487512

488513
- Fileinfo:
489-
. Upgraded to file 5.46.
514+
. Upgraded file from 5.45 to 5.46.
490515
. The return type of finfo_close() has been changed to true, rather
491516
than bool.
492517

@@ -501,7 +526,7 @@ PHP 8.5 UPGRADE NOTES
501526
RFC: https://wiki.php.net/rfc/url_parsing_api
502527

503528
- PCRE:
504-
. Upgraded to pcre2lib from 10.44 to 10.45.
529+
. Upgraded pcre2lib from 10.44 to 10.45.
505530

506531
- PDO_Sqlite:
507532
. Increased minimum release version support from 3.7.7 to 3.7.17.
@@ -517,12 +542,14 @@ PHP 8.5 UPGRADE NOTES
517542

518543
- Core:
519544
. PHP_BUILD_DATE.
545+
. PHP_BUILD_PROVIDER.
520546

521547
- Curl:
522548
. CURLINFO_USED_PROXY.
523549
. CURLINFO_HTTPAUTH_USED.
524550
. CURLINFO_PROXYAUTH_USED.
525551
. CURLINFO_CONN_ID.
552+
. CURLINFO_QUEUE_TIME_T.
526553
. CURLOPT_INFILESIZE_LARGE.
527554
. CURLFOLLOW_ALL.
528555
. CURLFOLLOW_OBEYCODE.
@@ -555,6 +582,9 @@ PHP 8.5 UPGRADE NOTES
555582
. T_VOID_CAST.
556583
. T_PIPE.
557584

585+
- Standard:
586+
. IMAGETYPE_SVG when libxml is loaded.
587+
558588
========================================
559589
11. Changes to INI File Handling
560590
========================================
@@ -672,6 +702,7 @@ PHP 8.5 UPGRADE NOTES
672702
. Improved unpack() performance with nameless repetitions by avoiding
673703
creating temporary strings and reparsing them.
674704
. Improved pack() performance.
705+
. Minor improvements in array_chunk() performance.
675706

676707
- XMLReader:
677708
. Improved property access performance.

UPGRADING.INTERNALS

Lines changed: 9 additions & 0 deletions
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
@@ -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
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
GH-19044: Protected properties must be scoped according to their prototype (protected(set) on non-hooked property)
3+
--FILE--
4+
<?php
5+
6+
class P {
7+
public mixed $foo { get => 42; }
8+
}
9+
10+
class C1 extends P {
11+
public protected(set) mixed $foo = 1;
12+
}
13+
14+
class C2 extends P {
15+
public protected(set) mixed $foo;
16+
17+
static function foo($c) { return $c->foo += 1; }
18+
}
19+
20+
var_dump(C2::foo(new C1));
21+
22+
?>
23+
--EXPECT--
24+
int(43)
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
--TEST--
2+
Clone with basic
3+
--FILE--
4+
<?php
5+
6+
class Dummy { }
7+
8+
$x = new stdClass();
9+
10+
$foo = 'FOO';
11+
$bar = new Dummy();
12+
$array = [
13+
'baz' => 'BAZ',
14+
'array' => [1, 2, 3],
15+
];
16+
17+
var_dump(clone $x);
18+
var_dump(clone($x));
19+
var_dump(clone($x, [ 'foo' => $foo, 'bar' => $bar ]));
20+
var_dump(clone($x, $array));
21+
var_dump(clone($x, [ 'obj' => $x ]));
22+
23+
var_dump(clone($x, [
24+
'abc',
25+
'def',
26+
new Dummy(),
27+
'named' => 'value',
28+
]));
29+
30+
?>
31+
--EXPECTF--
32+
object(stdClass)#%d (0) {
33+
}
34+
object(stdClass)#%d (0) {
35+
}
36+
object(stdClass)#%d (2) {
37+
["foo"]=>
38+
string(3) "FOO"
39+
["bar"]=>
40+
object(Dummy)#%d (0) {
41+
}
42+
}
43+
object(stdClass)#%d (2) {
44+
["baz"]=>
45+
string(3) "BAZ"
46+
["array"]=>
47+
array(3) {
48+
[0]=>
49+
int(1)
50+
[1]=>
51+
int(2)
52+
[2]=>
53+
int(3)
54+
}
55+
}
56+
object(stdClass)#%d (1) {
57+
["obj"]=>
58+
object(stdClass)#%d (0) {
59+
}
60+
}
61+
object(stdClass)#%d (4) {
62+
["0"]=>
63+
string(3) "abc"
64+
["1"]=>
65+
string(3) "def"
66+
["2"]=>
67+
object(Dummy)#%d (0) {
68+
}
69+
["named"]=>
70+
string(5) "value"
71+
}

0 commit comments

Comments
 (0)