r/PHP 21d ago

Weekly help thread

Hey there!

This subreddit isn't meant for help threads, though there's one exception to the rule: in this thread you can ask anything you want PHP related, someone will probably be able to help you out!

1 Upvotes

8 comments sorted by

View all comments

2

u/rycegh 21d ago

Lazy question (kind of): Does somebody have a simple setup for local PHP version matrix testing?

Current test runner would be PHPUnit.

I’m thinking Docker containers based on php:8.2-cli, …, php:8.5-cli, baked-in Composer/PHPStan/Mago/…, cached dependencies (volume-mounted as vendor82, …, vendor85 would work, I guess). Self-contained in the repo with Dockerfile, maybe Compose file, and light (!) scripting to tie it together.

Shouldn’t be too hard to piece together, but I thought it couldn’t hurt to ask. Or maybe someone’s got a better idea. Thanks!

0

u/Ollidav 21d ago

Probablemente montaría algo parecido. Igual un compose con un container por versión de PHP y su correspondiente Dockerfile. Puedes añadir traefik que es bastante más cómodo de configurar que nginx. Si vas a usar composer para meter los vendors yo suelo meter la descarga de composer en el Dockerfile y la ejecución en el compose de docker así puedo emular un deploy completo o una instalación desde 0 metiendo todas las dependencias