Official Psalm channel
63 subscribers
43 links
Official news channel for Psalm, a PHP static analysis tool for finding errors and security vulnerabilities in PHP applications!
Download Telegram
For anyone thinking about the release frequency: Psalm will be switching to rolling releases starting from v7, with automated releases every hour or so if CI passes; this already applies now to rcs and betas
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥5
Security analysis is on by default: types, taints and dead code in one pass, on a rewritten, 10x faster taint engine.

New: NoSQL, LLM prompt and URL injection, php://input and upload names as sources, taint through closures and generators.

Try it: https://psalm.dev/r/7631291cc5
Hack-style purity: declare which side effects code may have (io, time, write-props...) and catch the "pure" function that reads the clock or edits its input.

Purity templates make array_map() and your interfaces as pure as what you pass them.

Try it: https://psalm.dev/r/be7eb39420
Dead code detection on a reference graph: if nothing reachable uses it, Psalm finds it. Classes that only call each other, cycles included, and exceptions you create but never throw.

Try it: https://psalm.dev/r/31c62c069b
Template defaults for classes, functions and methods: Result<int> now means Result<int, RuntimeException>.

Libraries can add a template without breaking the types their users already wrote.

Try it: https://psalm.dev/r/4e21eb262e
PHP 8.6 pipelines with partial application, fully typed:

$slug = $title |> trim(...) |> str_replace(' ', '-', ?);
// string

$title |> explode(' ', ?) |> strtolower(...);
// InvalidArgument: strtolower expects string, non-empty-list<string> given

Try it: https://psalm.dev/r/3c08a570e0