php-expert

php-expert is a skill for Claude Code, Codex from personamanagmentlayer/pcl. It costs 21 tokens per session (5,167 once invoked), scanned A, original, Apache-2.0.

A guide to modern PHP, a programming language widely used for web applications. It covers PHP 8+, Laravel, Composer, object-oriented code, types, and current syntax.

In plain words
What is it for?
Use it to build or review PHP and Laravel applications, organise classes and packages, and apply strict typing and modern PHP syntax.
Why use it?
It helps developers update older PHP code and use modern language features without introducing type, dependency, or structure problems.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/personamanagmentlayer/pcl/php-expert
Any agent
npx skills add personamanagmentlayer/pcl --skill php-expert
Clone the repo
git clone --depth 1 https://github.com/personamanagmentlayer/pcl

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-expert

README.md
[![agentmods](https://agentmods.dev/badge/skills/personamanagmentlayer/pcl/php-expert.svg)](https://agentmods.dev/skills/personamanagmentlayer/pcl/php-expert)
Your own site
<a href="https://agentmods.dev/skills/personamanagmentlayer/pcl/php-expert"><img src="https://agentmods.dev/badge/skills/personamanagmentlayer/pcl/php-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,167 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00021 $0.05167
Opus 5 $0.00010 $0.02583
Sonnet 5 $0.00004 $0.01033
Haiku 4.5 $0.00002 $0.00517

Measured yesterday against content hash 128f1ef4b0ac, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

php-expert 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 yesterday.

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.

stdlib/languages/php-expert/SKILL.md · 955 lines

How it starts

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

PHP Expert

Expert guidance for modern PHP development including PHP 8+ features, Laravel framework, Composer dependency management, and PHP best practices.

Core Concepts

PHP 8+ Features

  • Union types and mixed type
  • Named arguments
  • Attributes (annotations)
  • Constructor property promotion
  • Match expressions
  • Nullsafe operator
  • JIT compiler
  • Fibers (PHP 8.1+)
  • Readonly properties and classes

Object-Oriented PHP

  • Classes and objects
  • Interfaces and abstract classes
  • Traits
  • Namespaces
  • Autoloading (PSR-4)
  • Type declarations
  • Visibility modifiers

Modern PHP

  • Strict types
  • Return type declarations
  • Property type declarations
  • Enums (PHP 8.1+)
  • First-class callable syntax

Modern PHP 8+ Syntax

Constructor Property Promotion

<?php

// Before PHP 8
class User {
    private string $name;
    private string $email;
    private int $age;

    public function __construct(string $name, string $email, int $age) {
        $this->name = $name;
        $this->email = $email;
        $this->age = $age;
    }
}

// PHP 8+ (constructor property promotion)
class User {
    public function __construct(
        private string $name,
        private string $email,
        private int $age,
    ) {}

    public function getName(): string {
        return $this->name;
    }
}

$user = new User('Alice', '[email protected]', 30);

Named Arguments

<?php

function createUser(
    string $name,
    string $email,
    int $age = 18,
    bool $admin = false,
): User {
    return new User($name, $email, $age, $admin);
}

// Named arguments (PHP 8+)
$user = createUser(
    name: 'Alice',
    email: '[email protected]',
    age: 30,
    admin: true,
);

// Skip optional parameters
$user = createUser(
    name: 'Bob',
    email: '[email protected]',
);

Union Types and Mixed

<?php

// Union types (PHP 8+)
function processValue(int|float $number): int|float {
    return $number * 2;
}

function findUser(int|string $identifier): ?User {
    if (is_int($identifier)) {
        return User::find($identifier);
    }
    return User::where('email', $identifier)->first();
}

// Mixed type (accepts any type)
function debugValue(mixed $value): void {
    var_dump($value);
}

Read the full file on GitHub · 955 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. yesterday First seen · 955 lines · 21 tokens per session scan A 128f1ef4b0ac

Subscribe to this mod's changes

php-expert is a skill published in the GitHub repository personamanagmentlayer/pcl (41 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 21 tokens to every session and 5,167 once invoked, about $0.0001 per session on Opus 5. 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-09-03.