php

Generate PHP 8+ code with union types, enums, and attributes.

77|4|Updated Jun 20, 2022
One-click install
npx skills add https://github.com/htlin222/dotfiles --skill php-htlin222
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php
Source: https://github.com/htlin222/dotfiles/tree/main/claude.symlink/skills-archive/php
Command: npx skills add https://github.com/htlin222/dotfiles --skill php-htlin222

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers write modern, performant PHP code, leveraging advanced language features and best practices for efficient development.

Core Features & Use Cases

  • Modern PHP Syntax: Utilizes PHP 8+ features like union types, constructor property promotion, enums, match expressions, and attributes.
  • Memory Efficiency: Implements generators for memory-efficient iteration over large datasets.
  • Data Structures: Demonstrates the use of SPL data structures like priority queues and fixed arrays.
  • Error Handling: Shows robust error handling with custom exceptions and multi-type catch blocks.
  • Use Case: Refactor legacy PHP code to use modern features for improved readability and performance, or develop new features using the latest PHP capabilities.

Quick Start

Use the php skill to generate a PHP function that accepts a union type and returns an array or false.

Frequently Asked Questions about php

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write modern PHP code using PHP 8 features like union types and enums?

Process large datasets in PHP memory-efficiently by implementing generators. Generators allow you to iterate over large datasets without loading the entire collection into memory, significantly reducing your application's memory footprint.

What is the best way to refactor legacy PHP code to use modern syntax?

Handle errors robustly in PHP using custom exceptions and multi-type catch blocks. This modern error handling mechanism allows you to catch multiple exception types in a single block, simplifying your error management logic.

Does this PHP code generation approach support Laravel and Symfony frameworks?

Yes, this approach supports development and optimization for frameworks like Laravel and Symfony. It facilitates creating modern, performant PHP code tailored to these specific development environments.

How do I use SPL data structures like priority queues in PHP?

Use SPL data structures in PHP, such as priority queues and fixed arrays, for specialized data management. These built-in structures provide optimized performance for specific data processing tasks compared to standard arrays.