skillfed

php

This skill covers contemporary PHP development with PHP 7.4+ and 8.x features, including strict typing, constructor promotion, union and intersection types, and attributes. It explores object-oriented patterns through traits, interfaces, and abstract classes, plus enums and custom exception handling.

PHP teaches modern PHP 8.x syntax, type system features, and OOP patterns for current development practices.

AI-generated summary based on this skill's SKILL.md

19 5 MIT updated by miles990

Install

miles990/claude-software-skills/php · repository language: TypeScript

git clone https://github.com/miles990/claude-software-skills
cp -r claude-software-skills/programming-languages/php ~/.claude/skills/php
npx skillfed install miles990/claude-software-skills/php

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What modern PHP 8.x syntax and type system features does php cover?

php covers contemporary PHP development with PHP 7.4+ and 8.x features including strict typing, constructor promotion, union and intersection types, and attributes. The skill emphasizes modern syntax that improves code clarity and enables better static analysis for type safety.

How do I use php traits and interfaces in object-oriented design?

php explores OOP patterns through traits, interfaces, and abstract classes. Traits enable code reuse across unrelated classes, interfaces define contracts for implementations, and abstract classes provide base functionality. Together they support flexible, maintainable architecture and design patterns.

What does php teach about dependency injection and service containers?

php covers dependency injection and service container patterns as core architectural concepts. These patterns decouple components, improve testability, and centralize object creation and configuration—essential for building scalable, maintainable applications.

How does php handle errors with custom exceptions and result types?

php teaches error handling through custom exceptions and result pattern approaches. Custom exceptions provide domain-specific error information, while result types offer functional alternatives for representing success or failure, enabling more predictable error management.

What collection and array operations does php cover?

php includes work with collections, arrays, and functional programming in PHP. The skill demonstrates modern array operations and collection patterns that support functional programming styles for cleaner, more expressive data manipulation.

Is php licensed under MIT?

Yes, php is released under the MIT license, allowing free use, modification, and distribution with minimal restrictions.

SKILL.md

rendered from the published skill — quoted content, verbatim

PHP

Overview

Modern PHP (7.4+/8.x) patterns including typed properties, attributes, and modern OOP features.


Modern PHP Features

Type System

```php <?php

declare(strict_types=1);

// Typed properties (PHP 7.4+) class User { public string $id; public string $email; public ?string $name = null; public bool $active = true; public array $roles = []; public DateTimeImmutable $createdAt;

// Constructor promotion (PHP 8.0+)
public function __construct(
    public readonly string $email,
    public readonly string $name,
    private string $password
) {
    $this-&gt;id = uniqid();
    $this-&gt;createdAt = new DateTimeImmutable();
}

}

// Union types (PHP 8.0+) function process(string|int $value):

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 4 files
programming-languages/php/SKILL.md
programming-languages/php/templates/README.md
programming-languages/php/templates/composer.json
programming-languages/php/templates/phpunit.xml

Related skills

Tags

type-safety modern-syntax backend-architecture design-patterns framework-agnostic object-composition functional-programming enterprise-patterns version-8-features code-organization