@@ -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,
@@ -180,6 +182,11 @@ PHP 8.5 UPGRADE NOTES
180
182
RFC: https://wiki.php.net/rfc/final_promotion
181
183
. #[\Override] can now be applied to properties.
182
184
RFC: https://wiki.php.net/rfc/override_properties
185
+ . The #[\DelayedTargetValidation] attribute can be used to suppress
186
+ compile-time errors from core (or extension) attributes that are used on
187
+ invalid targets. These errors are instead reported at runtime if and when
188
+ ReflectionAttribute::newInstance() is called.
189
+ RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute
183
190
184
191
- Curl:
185
192
. Added support for share handles that are persisted across multiple PHP
@@ -506,6 +513,11 @@ PHP 8.5 UPGRADE NOTES
506
513
hooks are final, and whether the property is virtual. This also affects
507
514
the output of ReflectionClass::__toString() when a class contains hooked
508
515
properties.
516
+ . ReflectionAttribute::newInstance() can now throw errors for internal
517
+ attributes if the attribute was applied on an invalid target and the
518
+ error was delayed from compile-time to runtime via the
519
+ #[\DelayedTargetValidation] attribute.
520
+ RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute
509
521
510
522
- Session:
511
523
. session_start is stricter in regard to the option argument.
@@ -623,6 +635,12 @@ PHP 8.5 UPGRADE NOTES
623
635
7. New Classes and Interfaces
624
636
========================================
625
637
638
+ - Core:
639
+ . DelayedTargetValidation is an attribute that, when added, delays any errors
640
+ from *other* internal attributes about being applied to invalid targets from
641
+ compile-time to runtime.
642
+ RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute
643
+
626
644
- Curl:
627
645
. CurlSharePersistentHandle representing a share handle that is persisted
628
646
across multiple PHP requests.
0 commit comments