Psalm
Get started
Documentation
Paid support
Plugins
Blog
GitHub
<?php /** * @template T as true|false * @param T $getAll * @return (T is true ? list<int> : int) */ function get(bool $getAll): int|array { if ($getAll) { return [1,2,3]; } else { return 1; } } get(false); // int get(true); // list<int>
Snippet created on January 19 2022 at 13:47 UTC
Settings
Get link