Skip to content

Commit f472b46

Browse files
committed
Merge branch 'master' into true-async-streams
2 parents fa73e3b + 49fdf49 commit f472b46

File tree

194 files changed

+3395
-1060
lines changed

Some content is hidden

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

194 files changed

+3395
-1060
lines changed

NEWS

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3-
?? ??? ????, PHP 8.5.0beta3
3+
?? ??? ????, PHP 8.5.0RC1
4+
5+
- Core:
6+
. Fixed bug GH-19765 (object_properties_load() bypasses readonly property
7+
checks). (timwolla)
8+
. The __sleep() and __wakeup() magic methods have been deprecated. (Girgias)
9+
10+
- URI:
11+
. Fixed bug GH-19780 (InvalidUrlException should check $errors argument).
12+
(nielsdos)
13+
14+
- Windows:
15+
. Fix GH-19722 (_get_osfhandle asserts in debug mode when given a socket).
16+
(dktapps)
17+
18+
11 Sep 2025, PHP 8.5.0beta3
419

520
- Core:
621
. Destructing non-array values (other than NULL) using [] or list() now
@@ -12,6 +27,9 @@ PHP NEWS
1227
. Using null as an array offset or when calling array_key_exists() is now
1328
deprecated. (alexandre-daubois)
1429
. Fixed bug GH-19681 (PHP_EXPAND_PATH broken with bash 5.3.0). (Remi)
30+
. Marks the stack as non-executable on Haiku. (David Carlier)
31+
. Deriving $_SERVER['argc'] and $_SERVER['argv'] from the query string is
32+
now deprecated. (timwolla, nicolasgrekas)
1533

1634
- CLI:
1735
. Fixed bug GH-19461 (Improve error message on listening error with IPv6
@@ -27,6 +45,20 @@ PHP NEWS
2745
- FPM:
2846
. Fixed failed debug assertion when php_admin_value setting fails. (ilutov)
2947

48+
- Filter:
49+
. Fixed bug GH-16993 (filter_var_array with FILTER_VALIDATE_INT|FILTER_NULL_ON_FAILURE
50+
should emit warning for invalid filter usage). (alexandre-daubois)
51+
52+
- Intl:
53+
. Added grapheme_strpos(), grapheme_stripos(), grapheme_strrpos(),
54+
grapheme_strripos(), grapheme_strstr(), grapheme_stristr() and
55+
grapheme_levenshtein() functions add $locale parameter (Yuya Hamada).
56+
. Fixed bug GH-11952 (Fix locale strings canonicalization for IntlDateFormatter
57+
and NumberFormatter). (alexandre-daubois)
58+
59+
- ODBC:
60+
. Removed driver-specific build flags and support. (Calvin Buckley)
61+
3062
- Opcache:
3163
. Fixed bug GH-19486 (Incorrect opline after deoptimization). (Arnaud)
3264
. Fixed bug GH-19601 (Wrong JIT stack setup on aarch64/clang). (Arnaud)
@@ -40,6 +72,10 @@ PHP NEWS
4072
- PDO:
4173
. Driver specific methods in the PDO class are now deprecated. (Arnaud)
4274

75+
- PDO_SQLITE:
76+
. Add PDO\Sqlite::ATTR_TRANSACTION_MODE connection attribute.
77+
(Samuel Štancl)
78+
4379
- Reflection:
4480
. Fix GH-19691 (getModifierNames() not reporting asymmetric visibility).
4581
(DanielEScherzer)
@@ -52,20 +88,27 @@ PHP NEWS
5288
(Girgias)
5389
. Fixed bug GH-19577 (Avoid integer overflow when using a small offset
5490
and PHP_INT_MAX with LimitIterator). (alexandre-daubois)
91+
. Implement GH-19188: Add support for new INI mail.cr_lf_mode.
92+
(alexandre-daubois)
5593

5694
- Streams:
5795
. Fixed bug GH-14506 (Closing a userspace stream inside a userspace handler
5896
causes heap corruption). (nielsdos)
5997
. Avoid double conversion to string in php_userstreamop_readdir(). (nielsdos)
6098

6199
- URI:
100+
. Added support for Uri\Rfc3986\Uri::with*() methods. (kocsismate)
62101
. Fixed memory management of Uri\WhatWg\Url objects. (timwolla)
63102
. Fixed memory management of the internal "parse_url" URI parser.
64103
(timwolla)
65104
. Fixed double-free when assigning to $errors fails when using
66105
the Uri\WhatWg\Url parser. (timwolla)
67106
. Reject out-of-range ports when using the Uri\Rfc3986\Uri parser.
68107
(timwolla)
108+
. Return null instead of 0 for Uri\Rfc3986\Uri::getPort() when the
109+
URI contains an empty port. (timwolla)
110+
. Fixed creation of the InvalidUrlException when not passing an
111+
errors zval to the internal whatwg parser. (timwolla)
69112
. Clean up naming of internal API. (timwolla)
70113

71114
28 Aug 2025, PHP 8.5.0beta2

UPGRADING

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ PHP 8.5 UPGRADE NOTES
9191
- ODBC:
9292
. ODBC now assumes that at least ODBC 3.5 functionality is available. The
9393
ODBCVER definition and build system flags to control it have been removed.
94+
. ODBC no longer has build flags to build against specific drivers (except
95+
for DB2) and removes special cases for those drivers. It is strongly
96+
recommended to use a driver manager like iODBC or unixODBC on non-Windows.
9497

9598
- Opcache:
9699
. The Opcache extension is now always built into the PHP binary and is always
@@ -266,6 +269,11 @@ PHP 8.5 UPGRADE NOTES
266269
. Added class constants Pdo_Sqlite::ATTR_EXPLAIN_STATEMENT,
267270
Pdo_Sqlite::EXPLAIN_MODE_PREPARED, Pdo_Sqlite::EXPLAIN_MODE_EXPLAIN,
268271
Pdo_Sqlite::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN.
272+
. Added PDO\Sqlite::ATTR_TRANSACTION_MODE connection attribute with
273+
possible values PDO\Sqlite::TRANSACTION_MODE_DEFERRED,
274+
PDO\Sqlite::TRANSACTION_MODE_IMMEDIATE,
275+
and PDO\Sqlite::TRANSACTION_MODE_EXCLUSIVE, allowing to configure
276+
the transaction mode to use when calling beginTransaction().
269277

270278
- Session:
271279
. session_set_cookie_params(), session_get_cookie_params(), and session_start()
@@ -379,6 +387,15 @@ PHP 8.5 UPGRADE NOTES
379387
. Using null as an array offset or when calling array_key_exists() is now
380388
deprecated. Instead an empty string should be used.
381389
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_using_values_null_as_an_array_offset_and_when_calling_array_key_exists
390+
. Deriving $_SERVER['argc'] and $_SERVER['argv'] from the query string for non-CLI
391+
SAPIs has been deprecated. Configure register_argc_argv=0 and switch to either
392+
$_GET or $_SERVER['QUERY_STRING'] to access the information, after verifying
393+
that the usage is safe.
394+
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_register_argc_argv_ini_directive
395+
. The __sleep() and __wakeup() magic methods have been deprecated. The
396+
__serialize() and __unserialize() magic methods should be used instead,
397+
or at the same time if compatibility with PHP 7 is required.
398+
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods
382399

383400
- Curl:
384401
. The curl_close() function has been deprecated, as CurlHandle objects are
@@ -494,6 +511,11 @@ PHP 8.5 UPGRADE NOTES
494511
PDO::sqliteCreateFunction() => Pdo\Sqlite::createFunction()
495512
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_driver_specific_pdo_constants_and_methods
496513

514+
- PDO_PGSQL: Constants related to transaction states have been deprecated:
515+
PDO::PGSQL_TRANSACTION_IDLE, PDO::PGSQL_TRANSACTION_ACTIVE, PDO::PGSQL_TRANSACTION_INTRANS,
516+
PDO::PGSQL_TRANSACTION_INERROR, PDO::PGSQL_TRANSACTION_UNKNOWN.
517+
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#extpdo_deprecations
518+
497519
- Reflection:
498520
. The setAccessible() methods of various Reflection objects have been
499521
deprecated, as those no longer have an effect.
@@ -555,6 +577,10 @@ PHP 8.5 UPGRADE NOTES
555577
TransLiterator::getErrorCode(), and TransLiterator::getErrorMessage()
556578
have dropped the false from the return type union. Returning false
557579
was actually never possible.
580+
. grapheme_strpos(), grapheme_stripos(), grapheme_strrpos(),
581+
grapheme_strripos(), grapheme_strstr(), grapheme_stristr() and
582+
grapheme_levenshtein() functions add $locale parameter.
583+
RFC: https://wiki.php.net/rfc/grapheme_add_locale_for_case_insensitive
558584

559585
- LDAP:
560586
. ldap_get_option() now accepts a NULL connection, as ldap_set_option(),

Zend/tests/attributes/constants/constant_listed_as_target-internal.phpt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ Constants listed in valid targets when used wrong (internal attribute)
33
--FILE--
44
<?php
55

6-
#[Deprecated]
7-
class Example {}
6+
function demo(
7+
#[Deprecated] $v
8+
) {}
89

910
?>
1011
--EXPECTF--
11-
Fatal error: Attribute "Deprecated" cannot target class (allowed targets: function, method, class constant, constant) in %s on line %d
12+
Fatal error: Attribute "Deprecated" cannot target parameter (allowed targets: class, function, method, class constant, constant) in %s on line %d
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
--TEST--
2+
#[\DelayedTargetValidation] with #[\Deprecated]: validator errors delayed
3+
--FILE--
4+
<?php
5+
6+
#[DelayedTargetValidation]
7+
#[Deprecated]
8+
interface DemoInterface {}
9+
10+
#[DelayedTargetValidation]
11+
#[Deprecated]
12+
class DemoClass {}
13+
14+
#[DelayedTargetValidation]
15+
#[Deprecated]
16+
enum DemoEnum {}
17+
18+
$cases = [
19+
new ReflectionClass('DemoInterface'),
20+
new ReflectionClass('DemoClass'),
21+
new ReflectionClass('DemoEnum'),
22+
];
23+
foreach ($cases as $r) {
24+
echo str_repeat("*", 20) . "\n";
25+
echo $r . "\n";
26+
$attributes = $r->getAttributes();
27+
var_dump($attributes);
28+
try {
29+
$attributes[1]->newInstance();
30+
} catch (Error $e) {
31+
echo get_class($e) . ": " . $e->getMessage() . "\n";
32+
}
33+
}
34+
35+
?>
36+
--EXPECTF--
37+
********************
38+
Interface [ <user> interface DemoInterface ] {
39+
@@ %s %d-%d
40+
41+
- Constants [0] {
42+
}
43+
44+
- Static properties [0] {
45+
}
46+
47+
- Static methods [0] {
48+
}
49+
50+
- Properties [0] {
51+
}
52+
53+
- Methods [0] {
54+
}
55+
}
56+
57+
array(2) {
58+
[0]=>
59+
object(ReflectionAttribute)#%d (1) {
60+
["name"]=>
61+
string(23) "DelayedTargetValidation"
62+
}
63+
[1]=>
64+
object(ReflectionAttribute)#%d (1) {
65+
["name"]=>
66+
string(10) "Deprecated"
67+
}
68+
}
69+
Error: Cannot apply #[\Deprecated] to interface DemoInterface
70+
********************
71+
Class [ <user> class DemoClass ] {
72+
@@ %s %d-%d
73+
74+
- Constants [0] {
75+
}
76+
77+
- Static properties [0] {
78+
}
79+
80+
- Static methods [0] {
81+
}
82+
83+
- Properties [0] {
84+
}
85+
86+
- Methods [0] {
87+
}
88+
}
89+
90+
array(2) {
91+
[0]=>
92+
object(ReflectionAttribute)#%d (1) {
93+
["name"]=>
94+
string(23) "DelayedTargetValidation"
95+
}
96+
[1]=>
97+
object(ReflectionAttribute)#%d (1) {
98+
["name"]=>
99+
string(10) "Deprecated"
100+
}
101+
}
102+
Error: Cannot apply #[\Deprecated] to class DemoClass
103+
********************
104+
Enum [ <user> enum DemoEnum implements UnitEnum ] {
105+
@@ %s %d-%d
106+
107+
- Constants [0] {
108+
}
109+
110+
- Static properties [0] {
111+
}
112+
113+
- Static methods [1] {
114+
Method [ <internal, prototype UnitEnum> static public method cases ] {
115+
116+
- Parameters [0] {
117+
}
118+
- Return [ array ]
119+
}
120+
}
121+
122+
- Properties [1] {
123+
Property [ public protected(set) readonly string $name ]
124+
}
125+
126+
- Methods [0] {
127+
}
128+
}
129+
130+
array(2) {
131+
[0]=>
132+
object(ReflectionAttribute)#%d (1) {
133+
["name"]=>
134+
string(23) "DelayedTargetValidation"
135+
}
136+
[1]=>
137+
object(ReflectionAttribute)#%d (1) {
138+
["name"]=>
139+
string(10) "Deprecated"
140+
}
141+
}
142+
Error: Cannot apply #[\Deprecated] to enum DemoEnum

Zend/tests/attributes/delayed_target_validation/with_Deprecated.phpt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ class DemoClass {
4040
}
4141
}
4242

43+
#[DelayedTargetValidation]
44+
#[Deprecated] // Does something here
45+
trait DeprecatedTrait {}
46+
47+
class WithDeprecatedTrait {
48+
use DeprecatedTrait;
49+
}
50+
4351
#[DelayedTargetValidation]
4452
#[Deprecated] // Does something here
4553
function demoFn() {
@@ -61,6 +69,7 @@ demoFn();
6169
var_dump(GLOBAL_CONST);
6270
?>
6371
--EXPECTF--
72+
Deprecated: Trait DeprecatedTrait used by WithDeprecatedTrait is deprecated in %s on line %d
6473
Got: example
6574

6675
Deprecated: Method DemoClass::printVal() is deprecated in %s on line %d
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--TEST--
2+
#[\Deprecated]: Using on a class
3+
--FILE--
4+
<?php
5+
6+
#[\Deprecated]
7+
class Demo {}
8+
9+
?>
10+
--EXPECTF--
11+
Fatal error: Cannot apply #[\Deprecated] to class Demo in %s on line %d
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--TEST--
2+
#[\Deprecated]: Using on an enum
3+
--FILE--
4+
<?php
5+
6+
#[\Deprecated]
7+
enum Demo {}
8+
9+
?>
10+
--EXPECTF--
11+
Fatal error: Cannot apply #[\Deprecated] to enum Demo in %s on line %d
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--TEST--
2+
#[\Deprecated]: Using on an interface
3+
--FILE--
4+
<?php
5+
6+
#[\Deprecated]
7+
interface Demo {}
8+
9+
?>
10+
--EXPECTF--
11+
Fatal error: Cannot apply #[\Deprecated] to interface Demo in %s on line %d

0 commit comments

Comments
 (0)