@@ -53,6 +53,8 @@ PHP 8.5 UPGRADE NOTES
53
53
. Applying #[\Attribute] to an abstract class, enum, interface, or trait triggers
54
54
an error during compilation. Previously, the attribute could be added, but when
55
55
ReflectionAttribute::newInstance() was called an error would be thrown.
56
+ The error can be delayed from compilation to runtime using the new
57
+ #[\DelayedTargetValidation] attribute.
56
58
57
59
- DOM:
58
60
. Cloning a DOMNamedNodeMap, DOMNodeList, Dom\NamedNodeMap, Dom\NodeList,
@@ -178,6 +180,11 @@ PHP 8.5 UPGRADE NOTES
178
180
RFC: https://wiki.php.net/rfc/pipe-operator-v3
179
181
. Constructor property promotion can now be used for final properties.
180
182
RFC: https://wiki.php.net/rfc/final_promotion
183
+ . The #[\DelayedTargetValidation] attribute can be used to suppress
184
+ compile-time errors from core (or extension) attributes that are used on
185
+ invalid targets. These errors are instead reported at runtime if and when
186
+ ReflectionAttribute::newInstance() is called.
187
+ RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute
181
188
182
189
- Curl:
183
190
. Added support for share handles that are persisted across multiple PHP
@@ -470,6 +477,11 @@ PHP 8.5 UPGRADE NOTES
470
477
hooks are final, and whether the property is virtual. This also affects
471
478
the output of ReflectionClass::__toString() when a class contains hooked
472
479
properties.
480
+ . ReflectionAttribute::newInstance() can now throw errors for internal
481
+ attributes if the attribute was applied on an invalid target and the
482
+ error was delayed from compile-time to runtime via the
483
+ #[\DelayedTargetValidation] attribute.
484
+ RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute
473
485
474
486
- Session:
475
487
. session_start is stricter in regard to the option argument.
@@ -587,6 +599,12 @@ PHP 8.5 UPGRADE NOTES
587
599
7. New Classes and Interfaces
588
600
========================================
589
601
602
+ - Core:
603
+ . DelayedTargetValidation is an attribute that, when added, delays any errors
604
+ from *other* internal attributes about being applied to invalid targets from
605
+ compile-time to runtime.
606
+ RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute
607
+
590
608
- Curl:
591
609
. CurlSharePersistentHandle representing a share handle that is persisted
592
610
across multiple PHP requests.
0 commit comments