@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> <Subject> [ <Description> ]
Parsing a @phpstan-assert-if-false tag produces an AssertIfFalseTag instance, carrying the asserted $type, the $subject it is asserted of and the $operator relating them, alongside the $name and optional $description every Tag already provides.
final class AssertIfFalseTag extends AssertionTag {}
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.
12 September 2026