performant-php
Installation
SKILL.md
Performant PHP Skill
Goal
Build fast, type-safe, maintainable PHP services using the current ecosystem (versions verified 2026-06-10). This is the language-level companion to performant-laravel.skill.md; use it for general PHP, Symfony, and framework-agnostic work.
Capabilities
1. Modern language baseline
- Target PHP 8.4+ (8.5 current stable). Use property hooks and asymmetric visibility (8.4) to remove boilerplate getters/setters; lazy objects (8.4) for deferred initialization; PDO driver-specific subclasses. On 8.5, the pipe operator
|>chains callables and the built-in URI extension parses/normalizes URLs (RFC 3986 / WHATWG). - Always
declare(strict_types=1);. Usereadonlyclasses/properties, enums (backed where serialized), first-class callable syntax, and constructor property promotion.
2. Runtime performance
- OPcache must be enabled in production; tune
opcache.memory_consumption,opcache.max_accelerated_files, andopcache.validate_timestamps=0(with deploy-time cache reset). - JIT (available 8.3+) more than doubles throughput on CPU-bound work (benchmarks ~+110%); negligible/negative for typical I/O-bound web requests — enable and measure, don't assume.
- FrankenPHP worker mode (Caddy-based app server) keeps the framework booted between requests — large latency wins for Laravel/Symfony; also gives Early Hints and real-time (Mercure). Alternative: RoadRunner or Swoole/OpenSwoole.
- Use
preloadfor hot framework classes.