php-modern
Installation
SKILL.md
Modern PHP 8.x Development
Before writing code
Fetch live docs: Web-search site:php.net manual migration for the latest PHP migration guide and new features. Check https://www.php.net/releases/ for current supported versions.
PHP 8.0 Features
Constructor Property Promotion
Declare and assign properties directly in the constructor signature — eliminates boilerplate. Heavily used in Magento service classes.
Named Arguments
Call functions with parameter names: array_slice(array: $arr, offset: 2). Improves readability for functions with many parameters.
Match Expressions
Type-safe switch replacement that returns a value. No fall-through, strict comparison. Better than switch for value mapping.