finds.dev← search

// the find

sebastianbergmann/php-text-template

★ 7,438 · PHP · BSD-3-Clause · updated Jul 2026

A simple template engine.

A minimal PHP string templating library that replaces `{{variable}}` placeholders in text files. It's the internal engine behind PHPUnit's code generation — test stubs, bootstrap files, that kind of thing. If you need Twig, this is not it.

Maintained by Sebastian Bergmann (PHPUnit author), so it has real-world stress-testing at scale through PHPUnit's own use. The tooling discipline is unusually thorough for a 150-line library: PHPStan at max level, strict rules via ergebnis/phpstan-rules, type-coverage enforcement, and CI that checks the API surface to catch accidental breakage. Zero dependencies in production — just PHP itself. Active maintenance with a push as of July 2026.

The template syntax is hardcoded `{{placeholder}}` with no way to change delimiters, so it will clash with any frontend template syntax you embed. No conditionals, loops, or filters — if you need anything beyond search-and-replace, you're writing PHP string concatenation anyway. The 7400 stars are mostly passive accumulation from PHPUnit's dependency graph, not organic adoption; the 30 forks tell the real story. Documentation is essentially nonexistent beyond the composer install line.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →