Re: [RFC] [Discussion] #[\Deprecated] attribute again v1.3

From: Date: Wed, 24 Apr 2024 17:18:28 +0000
Subject: Re: [RFC] [Discussion] #[\Deprecated] attribute again v1.3
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-123203@lists.php.net to get a copy of this message
I like the proposition and I like the idea of $since parameter, however, this option is too ambiguous about what should store. Should it store the PHP version, package version, or the date? What about setting this parameter vaguely as the boolean we can pass? #[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_FUNCTION)] class Deprecated { public function __construct( public readonly ?string $note = null, public readonly ?bool $since = null ) { } } #[Deprecated(since: $packageVersion > 5.5)] #[Deprecated(since: PHP_VERSION_ID > 80100)] #[Deprecated(since: date("Y-m-d") > "2024-01-21")] Kind regards, Jorg

« previous php.internals (#123203) next »