Skip to content

Tag reference

@phpstan-impure

The @phpstan-impure tag declares a function or method as impure — that is, having side effects — defined by PHPStan.

Grammar

"@phpstan-impure" [ <Description> ]

Examples

A method with side effects.
/**
* @phpstan-impure
*/
public function next(): int

Names by platform

phpstan
@phpstan-impure

Parsing a @phpstan-impure tag produces a PhpStanImpureTag instance. Being a pure marker, it adds nothing beyond the $name and optional $description every Tag already carries.

final class PhpStanImpureTag extends FlagTag {}

Documented by PHPStan.