@phpstan-assert-if-false
The @phpstan-assert-if-false tag asserts the given type when the function returns false, defined by PHPStan. It is one of the @phpstan-assert family of narrowing tags.
"@phpstan-assert-if-false" <Type> <Variable> [ <Description> ]
Parsing a @phpstan-assert-if-false tag produces an AssertIfFalseTag instance, carrying the asserted $type and $variable alongside the $name and optional $description every Tag already provides.
final class AssertIfFalseTag extends TypedVariableTag {}
The same AssertIfFalseTag is produced by @psalm-assert-if-false and @phan-assert-if-false, which restate the same assertion for their respective tools.
Documented by PHPStan.
08 July 2026