php-modern

php-modern is a skill for Claude Code from OrcaQubits/agentic-commerce-skills-plugins. It costs 52 tokens per session (947 once invoked), scanned A, original, MIT.

A guide to writing modern PHP 8.x code using features such as typed properties, enums, attributes, match expressions, and constructor promotion. PHP is a programming language commonly used for web applications.

In plain words
What is it for?
Use it when writing or updating PHP 8.x applications, including Magento projects, with explicit types, immutable data, concise constructors, and modern control flow.
Why use it?
It helps you use newer language features correctly instead of relying on older, more verbose code styles.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the magento2-commerce plugin — 19 skills, 1 agent shipped together

Good fit Use it when writing or updating PHP 8.x applications, including Magento projects, with explicit types, immutable data, concise constructors, and modern control flow.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/orcaqubits/agentic-commerce-skills-plugins/php-modern
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 OrcaQubits/agentic-commerce-skills-plugins --skill php-modern
Clone the repo
git clone --depth 1 https://github.com/OrcaQubits/agentic-commerce-skills-plugins

Made for: Claude Code.

Or install magento2-commerce, the plugin that ships this one along with the rest of its 19 skills, 1 agent.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/orcaqubits/agentic-commerce-skills-plugins/php-modern/github.svg)](https://agentmods.dev/skills/orcaqubits/agentic-commerce-skills-plugins/php-modern)
Your own site
<a href="https://agentmods.dev/skills/orcaqubits/agentic-commerce-skills-plugins/php-modern"><img src="https://agentmods.dev/badge/skills/orcaqubits/agentic-commerce-skills-plugins/php-modern/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-modern

Your own site · 80×15
<a href="https://agentmods.dev/skills/orcaqubits/agentic-commerce-skills-plugins/php-modern"><img src="https://agentmods.dev/badge/skills/orcaqubits/agentic-commerce-skills-plugins/php-modern.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 947 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.00052 $0.00947
Opus 5.5 $0.00021 $0.00379
Sonnet 5.5 $0.00010 $0.00189
Haiku 4.5 $0.00005 $0.00095

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

Security

Grade A, and why

php-modern 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.

magento2-commerce/skills/php-modern/SKILL.md · 145 lines

How it starts

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

Modern PHP 8.x Development

Before writing code

Fetch live docs: Web-search site:php.net manual migration for the latest PHP migration guide and new features. Check https://www.php.net/releases/ for current supported versions.

PHP 8.0 Features

Constructor Property Promotion

Declare and assign properties directly in the constructor signature — eliminates boilerplate. Heavily used in Magento service classes.

Named Arguments

Call functions with parameter names: array_slice(array: $arr, offset: 2). Improves readability for functions with many parameters.

Match Expressions

Type-safe switch replacement that returns a value. No fall-through, strict comparison. Better than switch for value mapping.

Union Types

int|string in parameter and return types. Allows multiple type declarations.

Nullsafe Operator

$obj?->method()?->property — short-circuits to null if any part is null. Replaces nested null checks.

Attributes

Native metadata annotations: #[Route('/path')], #[Override]. Replace docblock annotations with first-class language support.

PHP 8.1 Features

Enums

First-class enumerations — backed (string/int) and unit enums. Perfect for status codes, types, categories. Use backed enums for database/API values.

Readonly Properties

public readonly string $name — can only be set once (usually in constructor). Enforces immutability.

Fibers

Lightweight concurrency primitives — PHP-level coroutines. Foundation for async frameworks. Limited direct usage in Magento.

Intersection Types

TypeA&TypeB — value must satisfy ALL types. Useful for ensuring a parameter implements multiple interfaces.

First-class Callable Syntax

strlen(...) creates a Closure from a function. Cleaner than Closure::fromCallable('strlen').

PHP 8.2 Features

Readonly Classes

readonly class Dto { ... } — all properties are implicitly readonly. Perfect for Data Transfer Objects and value objects.

Deprecated: Dynamic Properties

Read the full file on GitHub · 145 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 · 145 lines · 52 tokens per session scan A 7e64aadbda3b

Subscribe to this mod's changes

php-modern is a skill published in the GitHub repository OrcaQubits/agentic-commerce-skills-plugins (40 stars, last pushed 1mo ago), licensed MIT. It adds 52 tokens to every session and 947 once invoked, about $0.0002 per session on Opus 5.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-15.

Related

php-modern compared with skills from other repositories

php-modern next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
php-modernOrcaQubits/agentic-commerce-skills-pluginsSkill401mo agoMITA52Claude Code
near-api-jsinternet-court/internet-court-skillSkill7.1k11d agononeA159Claude Code
near-kitinternet-court/internet-court-skillSkill7.1k11d agononeA92Claude Code
archestra-dev-rust-napiarchestra-ai/archestraSkill4.4ktodaynoneA76Claude Code, Codex
near-smart-contractsinternet-court/internet-court-skillSkill7.1k11d agononeB58Claude Code
lucid-agentsdaydreamsai/lucid-agentsSkill2013mo agoMITA75Codex
lucid-agentsdaydreamsai/lucid-agentsSkill2013mo agoMITA75Codex