Skip to content

u/roxblnfk

In this archive from May 2020 to Dec 2026

4
posts
97
comments
4
media
448
score
8 saved before deletion

We're not comparing Rust vs PHP as languages. Rust is obviously faster in isolation, no argument there. We're comparing a specific framework: Laravel for Rust vs its PHP counterparts on the same API. "Of course PHP is the bottleneck" is exactly the assumption we tested, and here it didn't hold.

14 points

Oh, we also built an MCP server and a set of skills for Buggregator Trap and Server, allowing agents to use xDebug during the debugging process. Furthermore, it includes support for profilers, var-dumps, logs, email, Sentry, telemetry, and much more.

Now I’ll add a skill for the PHP Debugger, so that your tool can be used more extensively.

-3 points

You could check out OpenIDE (not to be confused with OpenIdea) -- it’s a fork of IDEA that’s free, runs faster, and supports many languages ​​right out of the box. I personally chose it for its AI-agent session manager (I’m not a fan of using ClaudeCode in the terminal).

I also noticed that AI support has been added to PHPStorm via the AIR plugin, though I haven’t tried it out yet.

---

For my part, I’m actually somewhat glad about this AI explosion -- it enabled the creation of a fantastic IntelliJ IDEA plugin for running tests. The irony, however, is that with the AI ​​boom, this plugin is now completely unnecessary.

-2 points

While this is true, we're not talking about a hello world call into a C function. Calls from Go to PHP are almost always long C calls with heavy data processing. So in the real world, the overhead is far from negligible; it is clearly visible in benchmarks.

1 points

llm/skills: AI skills as dependencies

https://github.com/roxblnfk/skills

Coding agents like Claude Code, Cursor and Codex read "skills": folders with a SKILL.md that describe a library's conventions and recipes. Most people copy them in by hand, and the copies soon fall out of date with the code.

My idea is to keep skills in the library's own repository, next to the code. On composer install, the plugin finds them and syncs them into .agents/skills/. It also symlinks .claude/skills, .cursor/skills and so on to that folder. When you update a package, its skills update too. You can also pull skills from any GitHub or GitLab repository, pin a version, and pick only the skills you want.

Security. A skill is a set of instructions that the agent runs with your permissions, so any dependency could use one for prompt injection. By default, only your direct dependencies are trusted, because you chose them yourself. Skills from transitive dependencies are skipped unless the vendor is on an allowlist. Archives are checked for path traversal, and skills:show / --dry-run show what would be installed and why.

composer require --dev llm/skills

I'd love feedback, especially from library authors.

1 points

Reading this from the PHP/Spiral + RoadRunner side, most of your principles map 1:1, with one difference: in several places we use the same tools etcd does rather than PHP analogs. .proto files are the actual source of truth -- DTOs and clients are generated from them, not written by hand. gRPC interceptors handle cross-cutting concerns instead of Messenger middleware. Observability is wired into the runtime rather than added per-handler. With RoadRunner's Connect plugin the browser story is solved too, so "REST" has essentially disappeared from our stack. Goodbye to OpenAPI annotations and hello .proto.

A couple of things worth adding rather than just nodding along:

On contracts (principle 1). One thing the comparison flattens: DTOs and .proto files don't live in the same place. A DTO is the contract within a service - PHPStan catches it when the controller and the service disagree about a type. A .proto file is the contract between services: change a field, and every consumer's build fails on the next regeneration. And if you follow proto's evolution rules, you can keep shipping changes without breaking any consumer. Tools like buf breaking enforce this in CI.

On "simple outside, rocket science inside" (principle 5). This is essentially the design philosophy Temporal is built on: yield $activity->charge($order) hides retries, durability, recovery from process death, the whole thing. Working with it for a year did more for my sense of distributed systems discipline than any amount of "best practices" reading.

0 points

Yes, in that regard, it's true 👍

I use the package as a dev dependency in libraries, so it helps during package development, but doesn't affect other projects.

1 points

It seems you're a very driven person.

Testo is just getting started, and before we can accomplish such great things, we first need to push the framework to release and achieve full feature parity with other frameworks.

In any case, I suggest moving this topic to Testo Issues.

2 points

PHP's testing is actually quite good. There's an xUnit implementation in the form of PHPUnit. There's PEST for Jest fans. There's Codeception, which is still quite popular and used in modern projects.

For the average user, everything is just fine. The problems begin elsewhere: with framework and library developers. With the open source that underpins everything else.

Let me give you an example. I develop frameworks and SDKs for the enterprise sector. Besides all the requirements for reliability and stability, Enterprise loves LTS versions, even when it comes to PHP versions.

Let's get back to our testing frameworks. Pest and Codeception are based on PHPUnit, so PHPUnit's dictates also apply to them. And every couple of years, PHPUnit breaks backward compatibility and raises the minimum PHP version.

  • You might say, "It's not so bad, just use the old PHPUnit." Yes, I can use the old PHPUnit until a CVE is discovered that will crash all my pipelines, which is what's been happening lately.
  • I've been waiting for this extension point for several years. I don't know how many similar requests have been created, but I started working on Testo right after Sebastian closed my issue without even trying to figure it out. The feature was introduced in PHPUnit 13, but not all library and framework developers can upgrade to it.
  • Look at this, it's absolutely "wonderful": PHPUnit 12.2.0 breaks Rector test case

You can defend PHPUnit — that's your right. But if a tool doesn't solve the community's problems, then it's only a matter of time before a new one is created.

I'm showing you Testo. It's not necessary for everyone, because PHPUnit or Pest will suffice for 90% of cases.
You don't need to drop everything and switch to it right away, especially if you're happy with everything.

2 points

Oh, you're (absolutely) right: it would be possible to port all the features to PHPUnit, and even more. But there's one problem: it does not evolve.

Many features and improvements simply can't get there because of the high barrier. PHPUnit is afraid of innovation.

In fact, Testo is very late. It wasn't worth waiting so long for some miracle from PHPUnit; Testo should have been created five years ago.

1 points
  1. No inheritance from TestCase. Fust classes or functions.
  2. Flaky tests and Retry Policy
  3. PHP 8.2+ -- good for packages and frameworks
  4. Attributes driven. #[Test], #[TestInline], #[Bench], #[ExpectException], #[Retry], #[Repeat], #[DataSet], #[DataCross], #[BeforeTest], etc...
  5. Assert/Expect API:

​

Assert::same($actuial, 200); // Direct params order
Assert::array($order->items)
    ->allOf(Item::class)
    ->hasCount(3);

Expect::exception(ValidationException::class)
    ->fromMethod(Service::class, 'validateInput')
    ->withMessage('Invalid input')
    ->withPrevious(
        WrongTypeException::class,
        static fn (ExpectedException $e) => $e
            ->withCode(42)
            ->withMessage('Field "age" must be integer.'),
    );

Expect::notLeaks($service, $entity);
  1. Benchmarks using just one attribute

    #[Bench( callables: [ 'alternative' => [self::class, 'sumInCycle']], arguments: [1, 5_000], )] public static function sumInArray(int $a, int $b): int { return \array_sum(\range($a, $b)); }

  2. Inline tests for simple pure private functions

    #[TestInline([1, 1], 2)] #[TestInline([40, 2], 42)] #[TestInline([-5, 5], 0)] private static function sum(int $a, int $b): int { return $a + $b; }

4 points

It's literally one line in composer.json and a few lines in composer.lock because of metapackage. In return, I get a clean vendor directory.

Good deal.

0 points

I agree with much of your POV. Yes, I'm not good at marketing, so I didn't load the post with what's in the article, assuming that the developer would spend at least 15 seconds on it and get answers to their questions. I will likely follow your advice when Testo is released.
By independent architecture, I meant that it's not just another wrapper over PHPUnit.

I also agree that if PHPUnit suits you, there's no reason to look at something else. This applies to any stack, really.

Should I retry to sell you this new car in the comments?

1 points

I try to get rid of "parasitic" packages because they clutter navigation in PHP Storm.

I wrote a package roxblnfk/unpoly that removes polyfill-php* packages.
And you know what I encountered in one of the projects? There was a conflict with the polyfill-php72 (or 71, doesn't matter) in some dependency. Since my unpoly replaces polyfills, the package manager thinks that some package conflicts with mine.

Solution: roxblnfk/unpoly now has many versions, adding one polyfill at a time in descending order in each version.

2 points

I didn't spend even half the time on my library as you did, and I didn't even know there was a testing utility 😄

It seems it's time to write proper acceptance tests.

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.