-
-
Notifications
You must be signed in to change notification settings - Fork 913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
must_use function #12738
Comments
There will likely be Besides, |
@claudepache
Very strange, but it's JetBrains/PhpStorm that provides them. More details can be found in the linked comments and PR. |
Yeah, let's wait for the PHP RFC to pass. Meanwhile, you can use |
Feature request
Rust refers to functions that should not discard their return values when used on a separate line as
#[must_use]
, regardless of whether they have side effects. Similarly, PhpStorm marks such functions with#[Pure(true)]
.ob_get_contents()
is clearly an impure function with state, but it doesn't make sense to writeob_get_contents();
on a separate line.#[Pure(true)]
means that.refs phpstan/phpstan-src#3867 (comment)
refs #11101
Did PHPStan help you today? Did it make you happy in any way?
Tomorrow is the last day of my two-week spring internship at the company that employs me. The intern, who didn't know PHPStan, can now teach me the inner mechanisms of it. 🥰
The text was updated successfully, but these errors were encountered: