技能 php-pro
📦

php-pro

安全

Master modern PHP development with expert guidance

Struggling with legacy PHP patterns and inefficient code? This skill delivers memory-efficient generators, SPL data structures, and PHP 8+ features for production-ready applications.

支援: Claude Codex Code(CC)
🥉 75 青銅
1

下載技能 ZIP

2

在 Claude 中上傳

前往 設定 → 功能 → 技能 → 上傳技能

3

開啟並開始使用

測試它

正在使用「php-pro」。 Generate a memory-efficient CSV processor

預期結果:

A generator-based PHP class that yields processed rows one at a time, with type declarations, custom exceptions for malformed data, and configurable delimiters. Includes iterator implementation for foreach compatibility.

正在使用「php-pro」。 Create a type-safe repository pattern

預期結果:

Abstract repository class with generics-like type hints using templates, concrete implementations for specific entities, and interface contracts. Demonstrates late static binding and trait-based caching.

安全審計

安全
v1 • 2/24/2026

This is a prompt-only skill with no executable code. Static analysis scanned 0 files and detected 0 security issues. The skill provides guidance for PHP development without any dangerous patterns, network access, or filesystem operations. Safe for publication.

0
已掃描檔案
0
分析行數
0
發現項
1
審計總數
未發現安全問題
審計者: claude

品質評分

38
架構
100
可維護性
87
內容
50
社群
100
安全
100
規範符合性

你能建構什麼

Enterprise PHP Development

Build scalable, type-safe PHP applications following modern standards and PSR guidelines for enterprise environments.

Performance Optimization

Refactor memory-intensive code using generators and SPL structures to reduce footprint and improve response times.

PHP Modernization

Upgrade legacy PHP codebases to PHP 8+ with enums, match expressions, and constructor property promotion.

試試這些提示

Basic PHP Function with Type Safety
Create a PHP function that processes an array of user data. Use strict typing, return type declarations, and proper error handling with exceptions.
Generator for Large Dataset Processing
Write a PHP generator function that reads and processes a CSV file with millions of rows without loading everything into memory. Include error handling and validation.
SPL Data Structure Implementation
Implement a priority queue using SplPriorityQueue for a task scheduler. Include custom task objects with priority levels and deadline handling.
PHP 8 Modern Class with All Features
Create a comprehensive PHP 8+ class demonstrating constructor property promotion, enums for status values, attributes for metadata, and match expressions for complex logic. Include interfaces and traits for extensibility.

最佳實務

  • Always enable strict_types=1 for predictable type coercion behavior
  • Use generators for iterating over large datasets to minimize memory usage
  • Prefer SPL data structures when they provide clear performance or semantic benefits

避免

  • Loading entire files or large datasets into arrays before processing
  • Using array_count_values or similar functions on unbounded data without memory consideration
  • Mixing business logic with presentation code instead of following separation of concerns

常見問題

What PHP version does this skill target?
This skill focuses on PHP 8.0+ features including enums, match expressions, union types, and constructor property promotion. Code examples work on PHP 8.0 and later versions.
Can this skill help with Laravel or Symfony frameworks?
Yes, the core PHP principles apply to all frameworks. While focused on vanilla PHP, the patterns and techniques translate directly to Laravel, Symfony, and other frameworks.
Does this skill generate executable code or just guidance?
This skill provides both complete code examples and architectural guidance. All code is production-ready with proper typing, error handling, and documentation.
How do generators improve PHP performance?
Generators yield values one at a time instead of building complete arrays in memory. This reduces memory usage from O(n) to O(1) for iteration, crucial for processing large datasets.
When should I use SPL data structures over arrays?
Use SPL structures when you need specific behavior: SplQueue for FIFO operations, SplStack for LIFO, SplHeap for priority ordering, or ArrayObject when object-style access is beneficial.
Can this skill help with PHP performance profiling?
Yes, the skill provides guidance on identifying bottlenecks using Xdebug, Blackfire, and built-in functions like memory_get_usage(). It also teaches optimization techniques for common performance issues.

開發者詳情

檔案結構

📄 SKILL.md