// writing.php
Articles for php[Architect], conference talks, and technical deep-dives.
In 2022, Microsoft disclosed a CVE for a 5400 RPM hard drive that could be crashed by playing Janet Jackson's 'Rhythm Nation.' This is not satire. This is security research.
Boost your PHP applications with the cerbero90/enum package. Discover how to simplify your code, add metadata, and streamline value checks with powerful enum enhancements.
PHP 8.4 introduces lazy objects — a powerful feature that delays object initialization until needed, enhancing performance and reducing memory usage.
Learn how to simplify PHP conditionals by using the empty() function to check for falsy values and improve readability.
Speaking at php[tek] 2026 — the premier PHP conference. Details and slides coming soon.
Did you miss PHP[tek] 2023? Catch up and checkout what you missed through the joind.in list of slides.
PHP 8.2 allows you to use null, true, and false as stand-alone types for function arguments and return values. Be more explicit with your type hints.
Most agentic systems fail because one prompt tries to do everything. Splitting work into discrete phases — each with a single deliverable and enforced constraints — produces dramatically more reliable results. Here's the architecture.
An agent that keeps exploring is an agent that never ships. Injecting explicit budget nudges at 70% and 85% of the turn limit — with escalating pressure to commit — is one of the highest-ROI prompt engineering techniques I've used.
Read-safe tools can run concurrently. Mutating tools must run in emission order. Classifying every tool as parallel-safe or not — and batching accordingly with Promise.all — cuts wall-clock time significantly with zero added risk.
At ~70% context capacity, stop and summarize. Keep the last 5 messages verbatim. Preserve hypothesis, decisions, and pending actions. Discard raw tool outputs. This compaction strategy keeps long-running agents coherent across hundreds of turns.
A knowledge base that never prunes itself becomes noise. Track which bullets were shown vs cited, detect which ones came from PRs that were closed unmerged, and soft-delete them automatically. The feedback loop that keeps a playbook accurate.
Fetch the PR diff, parse changed functions, filter generic noise names, then run ripgrep locally to trace every call site. A producer-consumer table generated in seconds — no SSH, no staging environment required. Here's the implementation.
Process-global singletons break the moment two concurrent requests share state. AsyncLocalStorage gives you request-scoped context that propagates through arbitrary async boundaries — including Promise.all fan-out — without changing any function signatures.
When an agent run fails, you need to know exactly what happened: which tools ran, how long they took, when cost ceilings were hit, and what state policy flags were in at each step. Structured episodic logging makes all of this replayable.
A single agent trying to explore code, write implementations, review diffs, and generate tests simultaneously performs worse at all of them. Specialist subagents with narrow scopes, distinct tool subsets, and separate token budgets produce better results.
Requiring agents to cite concrete evidence — grep hits, file line numbers, observed code patterns — before claiming high confidence fundamentally changes output quality. No evidence means low confidence means draft PR means human review. The discipline compounds.