PHP TypeLang Help

@psalm-assert-if-false

The @psalm-assert-if-false tag asserts the given type for an argument or variable when the function returns false. It is defined by the static analyzer Psalm, alongside @psalm-assert.

"@psalm-assert-if-false" <Type> <Variable> [ <Description> ]

Parsing a @psalm-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 @phpstan-assert-if-false and @phan-assert-if-false, which restate the same assertion for their respective tools.

See Psalm's supported annotations.

08 July 2026