run-on-3v4l
Execute PHP code on 3v4l.org to test runtime behavior across multiple PHP versions. Use when you need to verify what PHP actually does with a piece of code.
Analyse PHP code with PHPStan via the playground API. Tests across all PHP versions (7.2–8.5) and reports errors grouped by version. Supports configuring level, strict rules, and bleeding edge.
$ npx -y skills add phpstan/phpstan --skill analyse-with-phpstan --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/analyse-with-phpstanContext preview
The summary Claude sees to decide when to auto-load this skill.
Analyse PHP code with PHPStan via the playground API. Tests across all PHP versions (7.2–8.5) and reports errors grouped by version. Supports configuring level, strict rules, and bleeding edge.
name: analyse-with-phpstan description: Analyse PHP code with PHPStan via the playground API. Tests across all PHP versions (7.2–8.5) and reports errors grouped by version. Supports configuring level, strict rules, and bleeding edge. argument-hint: <php-code-or-file> disable-model-invocation: false
Analyse PHP code using the PHPStan playground API at `https://api.phpstan.org/analyse`. This runs PHPStan across PHP versions 7.2–8.5 and returns errors for each version.
The code to analyse: `$ARGUMENTS`
Get the PHP code to analyse. If `$ARGUMENTS` is a file path, read the file contents. The code must start with `<?php`.
Unless the user specified otherwise, use these defaults:
If the user asked for strict rules or bleeding edge, set those to `true`.
Submit the code via POST:
curl -s -X POST 'https://api.phpstan.org/analyse' \
-H 'Content-Type: application/json' \
-d '{
"code": "<PHP code, JSON-escaped>",
"level": "<level>",
"strictRules": <true|false>,
"bleedingEdge": <true|false>,
"treatPhpDocTypesAsCertain": <true|false>,
"saveResult": true
}'The code value must be properly JSON-escaped (escape quotes, backslashes, newlines).
The response JSON contains:
Convert `phpVersion` integers to readable strings: `Math.floor(v / 10000)` `.` `Math.floor((v % 10000) / 100)`.
Output the results in this format:
`https://phpstan.org/r/<id>`
**Level:** `<level>` | **Strict rules:** yes/no | **Bleeding edge:** yes/no
Group consecutive PHP versions that have identical errors (same messages, lines, and identifiers) into ranges. For example, if PHP 7.2–8.3 all report the same errors, show them as one group.
If all PHP versions report identical errors, show a single group:
**All PHP versions (no differences):**
| Line | Error | Identifier | |------|-------|------------| | 10 | `Parameter #1 $foo expects string, int given.` | `argument.type` |
If errors differ across versions, show separate groups:
**PHP 8.0 – 8.5:**
| Line | Error | Identifier | |------|-------|------------| | 10 | `Parameter #1 $foo expects string, int given.` | `argument.type` |
**PHP 7.2 – 7.4:**
No errors.
If there are no errors on any PHP version, say: **No errors found on any PHP version.**
PHP Static Analysis Tool - discover bugs in your code without running it!
Execute PHP code on 3v4l.org to test runtime behavior across multiple PHP versions. Use when you need to verify what PHP actually does with a piece of code.