Mglaman iconMglamanSep 3, 2026 ~5 min source read

Making the phpstan-drupal playground work for agents

Matt Glaman updated the phpstan-drupal playground so non-browser clients (agents) can create, fetch, and share reproduction links reliably by documenting the API, returning full URLs, providing Markdown output, and using proper status codes.

Share this story

Send the public story page.

Useful takeaways from this story.

Document the API: the site serves /llms.txt so agents can discover the API base URL, request/response shapes, and a bug filing recipe.

Provide Markdown reproductions: GET /result?id= &format=markdown yields a single document that includes code, saved errors, and a current re-run for easy agent consumption.

The useful part

You paste PHP, run PHPStan with phpstan-drupal against a real Drupal core install, and share the result link in an issue. The bugs were small, individually boring, and always someone else's turn on my list. What finally cleared them was working through them with an agent, which is also how the rest of this post happened.

How it works

  • The HTML shell served for /r/ carries a comment and a block pointing there, so an agent that fetches a share link and finds nothing can still find its way to the data.
  • When they differ, the Markdown shows both sets, and the agent knows the bug was probably already fixed before it starts digging.
  • It never quite worked right, and I never got around to fixing it.
  • JSON works for an agent, but it has to correlate line numbers with the code on its own, and it has to notice that tabs, the errors saved when the link was created, and upToDateTabs, the same code re-run...

What to take from it

Send "saveResult": false while it narrows the snippet down, then one final run with the default to get a link worth sharing. Two things I wanted: A reporter tells their agent, "push this reproduction to the playground," and gets a link to paste into the issue. I hand my agent a share link, and it reads the code and the error, then goes to fix the bug.

Example or evidence

  • See https://phpstan-drupal.mglaman.dev/llms.txt for the endpoints and request format.
  • Results are public and stored forever, which is the point for a bug report and the wrong thing for an agent iterating on a reduction.
  • Render a share link as Markdown GET /result?id= already returned the saved code and errors as JSON, plus a fresh re-run against the current runner.
  • curl -s "$BASE/result?id=e8500ee1-9159-4fea-a49b-27a46112101d&format=markdown" And the result # phpstan-drupal playground result.

Details worth keeping

The site is a Svelte app, so fetching a share link returned an empty. The API hostname was only discoverable by reading the source. Tell the agent where the API is The site now serves /llms.txt.

Related coverage

  • Thedroptimes: DrupalClaw pushes AI assistance beyond code suggestions into setup, debugging, database work, and repeatable Drupal operations.
  • Thedroptimes: A portable SKILL.md file does not guarantee portable installation.
  • Testmuai: AGENTS.md works best as a testing contract: the exact commands an agent must run, what done means, how to handle a failing suite, and what it must never touch.
  • Testmuai: Set up the Playwright MCP server in Claude Code, Cursor, and VS Code, see which browser tools it exposes, and run AI agents that write and self-heal tests.
  • Phoronix: A Phoronix Premium supporter recently relayed a request to see some fresh PHP performance benchmarks.

More context around this story.

PHP 7.4 To PHP 8.6 Benchmarks, PHP 8.6 JIT Performance
Phoronix iconPhoronixAug 19, 2026

PHP 7.4 To PHP 8.6 Benchmarks, PHP 8.6 JIT Performance

A Phoronix Premium supporter recently relayed a request to see some fresh PHP performance benchmarks. So here are some fresh numbers of PHP 7.4 through the latest PHP 8.5 code plus the current Git state of PHP 8.6 ahead of the official PHP 8.6.0 release later in the year. With PHP 8.6 is also a fresh look at the JIT pe

Keep reading in the app

Open the app view to save this story, compare related coverage, and continue from the same source.

Open in app