Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Modern PHP 8+ features including enums, attributes, readonly properties, and union types.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | -28% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 20% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 61% | 0% |
| case-01 | ✓→✓ | = Same ✓ | -26% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 70% | 0% |
php<?php enum UserStatus: string { case ACTIVE = 'active'; case INACTIVE = 'inactive'; case BANNED = 'banned'; public function label(): string { return match($this) { self::ACTIVE => 'Active User', self::INACTIVE => 'Inactive', self::BANNED => 'Banned User' }; } } // Usage $user->status = UserStatus::ACTIVE;
php<?php class User { public function __construct( public readonly int $id, public readonly string $email, public string $name ) {} } $user = new User(1, 'user@example.com', 'John'); // $user->id = 2; // Error: Cannot modify readonly property
php<?php function processValue(int|float|string $value): int|float { return is_string($value) ? (int)$value : $value; }
php<?php function createUser( string $name, string $email, bool $isActive = true ): User { // ... } // Usage $user = createUser( email: 'user@example.com', name: 'John Doe' );
php<?php #[Attribute] class Route { public function __construct( public string $path, public string $method = 'GET' ) {} } class UserController { #[Route('/api/users', 'GET')] public function index() {} }
php<?php $message = match($status) { UserStatus::ACTIVE => 'User is active', UserStatus::INACTIVE => 'User is inactive', UserStatus::BANNED => 'User is banned', default => 'Unknown status' };
Other measured skills in the registry, with their headline benchmark lift.