Skip to content

Commit 7b38cd0

Browse files
authored
Merge branch 'master' into opcache-memory-after-shm-setup
2 parents 3265c7c + 7f1b360 commit 7b38cd0

File tree

111 files changed

+2467
-600
lines changed

Some content is hidden

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

111 files changed

+2467
-600
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/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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ 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+
514
- OPcache:
615
. Disallow changing opcache.memory_consumption when SHM is already set up.
716
(timwolla)
@@ -10,11 +19,17 @@ PHP NEWS
1019
. socket_set_option for multicast context throws a ValueError
1120
when the socket family is not of AF_INET/AF_INET6 family. (David Carlier)
1221

22+
- Standard:
23+
. Add HEIF/HEIC support to getimagesize. (Benstone Zhang)
24+
. Implement #71517 (Implement SVG support for getimagesize() and friends).
25+
(nielsdos)
26+
1327
- URI:
1428
. Empty host handling is fixed. (Máté Kocsis)
1529
. Error handling of Uri\WhatWg\Url::withHost() is fixed when the input
1630
contains a port. Now, it triggers an exception; previously, the error
1731
was silently swallowed. (Máté Kocsis)
32+
. Support empty URIs with Uri\Rfc3986\Uri. (timwolla)
1833

1934
17 Jul 2025, PHP 8.5.0alpha2
2035

UPGRADING

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,16 @@ 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.
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.
191201

192202
- DOM:
193203
. Added Dom\Element::$outerHTML.
@@ -234,6 +244,16 @@ PHP 8.5 UPGRADE NOTES
234244
process was terminated unexpectedly. In such cases, a warning is emitted
235245
and the function returns false. Previously, these errors were silently
236246
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).
237257

238258
- XSL:
239259
. The $namespace argument of XSLTProcessor::getParameter(),
@@ -398,7 +418,8 @@ PHP 8.5 UPGRADE NOTES
398418
. get_exception_handler() allows retrieving the current user-defined exception
399419
handler function.
400420
RFC: https://wiki.php.net/rfc/get-error-exception-handler
401-
. 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.
402423
RFC: https://wiki.php.net/rfc/clone_with_v2
403424

404425
- Curl:
@@ -425,6 +446,9 @@ PHP 8.5 UPGRADE NOTES
425446
. Added grapheme_levenshtein() function.
426447
RFC: https://wiki.php.net/rfc/grapheme_levenshtein
427448

449+
- Opcache:
450+
. Added opcache_is_script_cached_in_file_cache().
451+
428452
- Pdo\Sqlite:
429453
. Added support for Pdo\Sqlite::setAuthorizer(), which is the equivalent of
430454
SQLite3::setAuthorizer(). The only interface difference is that the
@@ -512,11 +536,14 @@ PHP 8.5 UPGRADE NOTES
512536

513537
- Core:
514538
. PHP_BUILD_DATE.
539+
. PHP_BUILD_PROVIDER.
515540

516541
- Curl:
517542
. CURLINFO_USED_PROXY.
518543
. CURLINFO_HTTPAUTH_USED.
519544
. CURLINFO_PROXYAUTH_USED.
545+
. CURLINFO_CONN_ID.
546+
. CURLINFO_QUEUE_TIME_T.
520547
. CURLOPT_INFILESIZE_LARGE.
521548
. CURLFOLLOW_ALL.
522549
. CURLFOLLOW_OBEYCODE.
@@ -549,6 +576,9 @@ PHP 8.5 UPGRADE NOTES
549576
. T_VOID_CAST.
550577
. T_PIPE.
551578

579+
- Standard:
580+
. IMAGETYPE_SVG when libxml is loaded.
581+
552582
========================================
553583
11. Changes to INI File Handling
554584
========================================

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: 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+
}
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
--TEST--
2+
Clone with respects visiblity
3+
--FILE--
4+
<?php
5+
6+
class P {
7+
public $a = 'default';
8+
protected $b = 'default';
9+
private $c = 'default';
10+
public private(set) string $d = 'default';
11+
12+
public function m1() {
13+
return clone($this, [ 'a' => 'updated A', 'b' => 'updated B', 'c' => 'updated C', 'd' => 'updated D' ]);
14+
}
15+
}
16+
17+
class C extends P {
18+
public function m2() {
19+
return clone($this, [ 'a' => 'updated A', 'b' => 'updated B', 'c' => 'dynamic C' ]);
20+
}
21+
22+
public function m3() {
23+
return clone($this, [ 'd' => 'inaccessible' ]);
24+
}
25+
}
26+
27+
class Unrelated {
28+
public function m3(P $p) {
29+
return clone($p, [ 'b' => 'inaccessible' ]);
30+
}
31+
}
32+
33+
$p = new P();
34+
35+
var_dump(clone($p, [ 'a' => 'updated A' ]));
36+
var_dump($p->m1());
37+
38+
$c = new C();
39+
var_dump($c->m1());
40+
var_dump($c->m2());
41+
try {
42+
var_dump($c->m3());
43+
} catch (Error $e) {
44+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
45+
}
46+
47+
try {
48+
var_dump(clone($p, [ 'b' => 'inaccessible' ]));
49+
} catch (Error $e) {
50+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
51+
}
52+
53+
try {
54+
var_dump(clone($p, [ 'd' => 'inaccessible' ]));
55+
} catch (Error $e) {
56+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
57+
}
58+
59+
try {
60+
var_dump((new Unrelated())->m3($p));
61+
} catch (Error $e) {
62+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
63+
}
64+
65+
?>
66+
--EXPECTF--
67+
object(P)#%d (4) {
68+
["a"]=>
69+
string(9) "updated A"
70+
["b":protected]=>
71+
string(7) "default"
72+
["c":"P":private]=>
73+
string(7) "default"
74+
["d"]=>
75+
string(7) "default"
76+
}
77+
object(P)#%d (4) {
78+
["a"]=>
79+
string(9) "updated A"
80+
["b":protected]=>
81+
string(9) "updated B"
82+
["c":"P":private]=>
83+
string(9) "updated C"
84+
["d"]=>
85+
string(9) "updated D"
86+
}
87+
object(C)#%d (4) {
88+
["a"]=>
89+
string(9) "updated A"
90+
["b":protected]=>
91+
string(9) "updated B"
92+
["c":"P":private]=>
93+
string(9) "updated C"
94+
["d"]=>
95+
string(9) "updated D"
96+
}
97+
98+
Deprecated: Creation of dynamic property C::$c is deprecated in %s on line %d
99+
object(C)#%d (5) {
100+
["a"]=>
101+
string(9) "updated A"
102+
["b":protected]=>
103+
string(9) "updated B"
104+
["c":"P":private]=>
105+
string(7) "default"
106+
["d"]=>
107+
string(7) "default"
108+
["c"]=>
109+
string(9) "dynamic C"
110+
}
111+
Error: Cannot modify private(set) property P::$d from scope C
112+
Error: Cannot access protected property P::$b
113+
Error: Cannot modify private(set) property P::$d from global scope
114+
Error: Cannot access protected property P::$b
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
Clone with supports property hooks
3+
--FILE--
4+
<?php
5+
6+
class Clazz {
7+
public string $hooked = 'default' {
8+
set {
9+
$this->hooked = strtoupper($value);
10+
}
11+
}
12+
}
13+
14+
$c = new Clazz();
15+
16+
var_dump(clone($c, [ 'hooked' => 'updated' ]));
17+
18+
?>
19+
--EXPECTF--
20+
object(Clazz)#%d (1) {
21+
["hooked"]=>
22+
string(7) "UPDATED"
23+
}

0 commit comments

Comments
 (0)