You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove PHP version contraint from the #[\NoDiscard] attribute rule #14586
TL;DR: (a) the explicit use of #[\NoDiscard] is already an opt-in by itself, and (b) I am eager to benefit from the attribute via static analysis even though I am still running on 8.4.
#[\NoDiscard]
functionf(): int {
returnrandom_int(0, 4);
}
f(); // PHPStan should warn, regardless of PHP version
Of course, the (void) cast remains available in PHP 8.5+ only.
Activity
staabm commentedon May 7, 2026
is this the idea as suggested here #13009 ? ondrej had a opinion about it back then
VincentLanglet commentedon Sep 13, 2026
Would you be interested on doing the PR @claudepache I think it's an easy one and we will ping ondrej on it ;)
staabm commentedon Sep 13, 2026
Ondrej had a strong opinion on it. Not sure we could accept it
See #13009 (comment)
VincentLanglet commentedon Sep 13, 2026
I saw ondrej answer but I feel like the argument is correct here:
claudepache commentedon Sep 14, 2026
Done: phpstan/phpstan-src#6444
phpstan-bot commentedon Sep 14, 2026
Closed via merging phpstan/phpstan-src#6444
github-actions commentedon Oct 16, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.