Skip to editor
Psalm
Docs
Playground
Plugins
Blog
Paid support
Share
Fix issues
Show original
PHP
Settings
<?php // PHP 8.5 pipes + PHP 8.6 partial function application, typed at every stage function slug(string $title): string { $slug = $title |> trim(...) |> str_replace(' ', '-', ?); /** @psalm-trace $slug */; // string return $slug; } function lowercaseWords(string $title): string { return $title |> explode(' ', ?) |> strtolower(...); // InvalidArgument: strtolower expects string, non-empty-list<string> given } function wrongLength(string $title): string { return $title |> trim(...) |> strlen(...); // InvalidReturnStatement: int<0, max> does not match string } // Partial application infers the closure's signature $pad = str_pad(?, 10, '.', STR_PAD_LEFT); /** @psalm-trace $pad */; // Closure[pure](string): string echo $pad(42); // InvalidScalarArgument: expects string, 42 given
Issues
Types
idle
Saved Nov 2 2026 18:37 UTC
⌘/Ctrl+Enter
run
⌘/Ctrl+S
share
F8
/
⇧F8
next/prev issue