php

php is a skill for Claude Code, Codex from SumonMSelim/agentguard. It costs 0 tokens per session (1,457 once invoked), scanned A, original, MIT.

A reference for modern PHP 8.5 development, covering language features, application structure, security, asynchronous work, testing, and developer tools.

In plain words
What is it for?
It guides writing and reviewing PHP code, including type declarations, object-oriented design, immutable data objects, runtime configuration, architecture, security, testing, and tooling.
Why use it?
It helps developers avoid unsupported PHP versions, weak typing, unsafe practices, and unsuitable performance settings.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It guides writing and reviewing PHP code, including type declarations, object-oriented design, immutable data objects, runtime configuration, architecture, security, testing, and tooling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sumonmselim/agentguard/php
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add SumonMSelim/agentguard --skill php
Clone the repo
git clone --depth 1 https://github.com/SumonMSelim/agentguard

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for php

README.md
[![agentmods](https://agentmods.dev/badge/skills/sumonmselim/agentguard/php/github.svg)](https://agentmods.dev/skills/sumonmselim/agentguard/php)
Your own site
<a href="https://agentmods.dev/skills/sumonmselim/agentguard/php"><img src="https://agentmods.dev/badge/skills/sumonmselim/agentguard/php/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for php

Your own site · 80×15
<a href="https://agentmods.dev/skills/sumonmselim/agentguard/php"><img src="https://agentmods.dev/badge/skills/sumonmselim/agentguard/php.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,457 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01457
Opus 5.5 $0.00000 $0.00583
Sonnet 5.5 $0.00000 $0.00291
Haiku 4.5 $0.00000 $0.00146

Measured 1mo ago against content hash 30967c0418b2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

php scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/php/SKILL.md · 91 lines

How it starts

The opening of the file, as written. The whole thing — 91 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PHP

Runtime and versioning

  • Run PHP 8.4 (active support) or 8.5 (latest stable). Never run EOL versions — no security patches
  • declare(strict_types=1) at top of every file
  • OPcache enabled in production. opcache.preload for warm startup on 8.0+
  • JIT enabled for CPU-bound workloads: opcache.jit=tracing, opcache.jit_buffer_size=128M. Not beneficial for typical I/O-bound web apps — benchmark before enabling

Type system

  • Type-hint all parameters, return types, and properties. No mixed — use union types (int|string) or generics via PHPDoc
  • never return type for functions that always throw or exit
  • readonly properties for value objects and DTOs (8.1+). readonly classes (8.2+) for fully immutable objects
  • Asymmetric visibility (8.4+): public private(set) for properties readable everywhere but writable only within class
  • Property hooks (8.4+): get/set hooks on properties — eliminates getter/setter boilerplate. Incompatible with readonly
  • Intersection types (8.1+): Countable&Iterator. DNF types (8.2+): (A&B)|null
  • Typed class constants (8.3+): const string VERSION = '1.0'
  • #[Override] attribute (8.3+) on overriding methods — compiler-checked safety net
  • Enums over constants for closed value sets (8.1+). Backed enums (string/int) for serialisation
  • Named arguments for multi-param functions with non-obvious order. Not for all calls
  • match over switch — exhaustive, no fall-through, returns value
  • First-class callable syntax (8.1+): strlen(...) over Closure::fromCallable('strlen')

Modern syntax (8.4–8.5)

  • new without parentheses for chaining (8.4+): new Collection()->filter()->map()
  • Pipe operator (8.5+): $result = $value |> trim(...) |> strtolower(...) |> htmlspecialchars(...). Prefer over nested calls
  • clone with (8.5+): $new = clone $obj with {name: 'updated'}. Preferred over manual clone + property set
  • Static property asymmetric visibility (8.5+): same syntax as instance properties
  • Lazy objects (8.4+): built-in lazy initialisation via ReflectionClass::newLazyProxy(). Use for expensive dependencies in DI containers
  • Driver-specific PDO classes (8.4+): Pdo\Mysql, Pdo\Pgsql, Pdo\Sqlite — type-safe, IDE-friendly alternatives to generic PDO

Read the full file on GitHub · 91 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 91 lines · 0 tokens per session scan A 30967c0418b2

Subscribe to this mod's changes

php is a skill published in the GitHub repository SumonMSelim/agentguard (54 stars, last pushed 14d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,457 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

laravel-specialist

Build and configure Laravel 10+ applications, including creating Eloquent models and relationships, implementing Sanctum authentication, configuring Horizon queues, designing RESTful APIs with API resources, and building reactive interfaces with Livewire. Use when creating Laravel models, setting up queue workers…

Jeffallan/claude-skills · 86 tokens

laravel-security

Laravel security best practices for authn/authz, validation, CSRF, mass assignment, file uploads, secrets, rate limiting, and secure deployment.

hashgraph-online/awesome-codex-plugins · 34 tokens

integration-fixture

Add a .test integration fixture for one behavior.

phel-lang/phel-lang · 10 tokens

Behat BDD Testing

PHP BDD testing with Behat framework using Gherkin feature files, Mink browser extension, context classes, and Symfony integration for behavior-driven acceptance testing.

PramodDutta/qaskills · 37 tokens

create-module

Scaffold a new Marko module — a self-contained Composer package with composer.json, namespaced src/, and Pest tests. Use this skill whenever the user asks to create, add, or scaffold a new Marko module or package. Concrete triggers: 'create a module named payment', 'scaffold an acme/blog package', 'add a new module…

marko-php/marko · 120 tokens

phel-lang

Building applications WITH Phel (Lisp that compiles to PHP). Triggers on .phel files, phel-config.php, phel CLI commands (init, run, repl, test, build), or requests to build a Phel app. Skip when working on the Phel compiler itself.

phel-lang/phel-lang · 65 tokens