Tag reference
@pure
The @pure tag declares a function or method as pure, meaning it is free of side effects: calling it repeatedly with the same arguments always produces the same result, without observably mutating any state.
Grammar
"@phan-pure" [ <Description> ]"@phpstan-pure" [ <Description> ]"@psalm-pure" [ <Description> ]Examples
/** * @phan-pure */function add(int $a, int $b): int/** * @phpstan-pure */function slug(string $title): string/** * @psalm-pure */function square(int $value): intNames by platform
- phan
@phan-pure- phpstan
@phpstan-pure- psalm
@psalm-pure