@@ -53,6 +53,8 @@ PHP 8.5 UPGRADE NOTES
5353 . Applying #[\Attribute] to an abstract class, enum, interface, or trait triggers
5454 an error during compilation. Previously, the attribute could be added, but when
5555 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.
5658
5759- DOM:
5860 . Cloning a DOMNamedNodeMap, DOMNodeList, Dom\NamedNodeMap, Dom\NodeList,
@@ -184,6 +186,11 @@ PHP 8.5 UPGRADE NOTES
184186 RFC: https://wiki.php.net/rfc/final_promotion
185187 . #[\Override] can now be applied to properties.
186188 RFC: https://wiki.php.net/rfc/override_properties
189+ . The #[\DelayedTargetValidation] attribute can be used to suppress
190+ compile-time errors from core (or extension) attributes that are used on
191+ invalid targets. These errors are instead reported at runtime if and when
192+ ReflectionAttribute::newInstance() is called.
193+ RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute
187194
188195- Curl:
189196 . Added support for share handles that are persisted across multiple PHP
@@ -521,6 +528,11 @@ PHP 8.5 UPGRADE NOTES
521528 hooks are final, and whether the property is virtual. This also affects
522529 the output of ReflectionClass::__toString() when a class contains hooked
523530 properties.
531+ . ReflectionAttribute::newInstance() can now throw errors for internal
532+ attributes if the attribute was applied on an invalid target and the
533+ error was delayed from compile-time to runtime via the
534+ #[\DelayedTargetValidation] attribute.
535+ RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute
524536
525537- Session:
526538 . session_start is stricter in regard to the option argument.
@@ -641,6 +653,10 @@ PHP 8.5 UPGRADE NOTES
641653- Core:
642654 . NoDiscard attribute was added.
643655 RFC: https://wiki.php.net/rfc/marking_return_value_as_important
656+ . DelayedTargetValidation is an attribute that, when added, delays any errors
657+ from *other* internal attributes about being applied to invalid targets from
658+ compile-time to runtime.
659+ RFC: https://wiki.php.net/rfc/delayedtargetvalidation_attribute
644660
645661- Curl:
646662 . CurlSharePersistentHandle representing a share handle that is persisted
0 commit comments