A new attribute for functions (TARGET_FUNCTION) and methods (TARGET_METHOD).

It enforces that the calling function consumes the return value.

A (void) cast disables it:

<?php
$a = new DateTimeImmutable();
*(void)* $a->setDate(2025, 5, 4);
?>

You can't use #[Discard] when: