Psalm
Get started
Documentation
Paid support
Plugins
Blog
GitHub
<?php /** @psalm-assert-if-true =int $x */ function equalsFive(mixed $x): bool { return is_int($x) && $x === 5; } function foo(mixed $y) : void { if (!equalsFive($y)) { throw new Exception(); } /** @psalm-trace $y */; // huh? I'm sure it's int here }
Snippet created on March 17 2023 at 12:33 UTC
Settings
Get link