Skip to editor
Psalm
Docs
Playground
Plugins
Blog
Paid support
Share
Fix issues
Show original
PHP
Settings
<?php /** * @psalm-type Person = array{name: string, age: int} */ /** * @psalm-return Person */ function getPerson_error(): array { $json = '{"name": "John", "age": 44}'; /** @psalm-var Person */ return json_decode($json, true); } /** * @psalm-return Person */ function getPerson_ok1(): array { $json = '{"name": "John", "age": 44}'; /** @psalm-var array{name: string, age: int} */ return json_decode($json, true); } /** * @psalm-return Person */ function getPerson_ok2(): array { $json = '{"name": "John", "age": 44}'; /** @psalm-var Person */ $person = json_decode($json, true); return $person; }
Issues
Types
idle
Saved Dec 11 2019 12:42 UTC
⌘/Ctrl+Enter
run
⌘/Ctrl+S
share
F8
/
⇧F8
next/prev issue