PHP 8.6 is out. Here is a starter that runs it on Railway in under two minutes.
PHP 8.6.0 shipped on 19 November 2026. The headline additions are partial function application, a new clamp() function, a Time\Duration class, a polling API in Io\Poll, and a built in SortDirection enum. Small tools on t
PHP 8.6.0 shipped on 19 November 2026. The headline additions are partial function application, a new clamp() function, a Time\Duration class, a polling API in Io\Poll, and a built in SortDirection enum. Small tools on their own, but together they remove a lot of hand written glue: no more min(max($value, $min), $max) to keep a number in range, no more guessing whether a timeout integer means seconds or milliseconds.
I wanted a clean way to try it on Railway, so I built a starter on the day it shipped. At the time there was no other PHP 8.6 template on Railway, and Docker Hub had no final 8.6.0 tags yet, so the first version compiled PHP from the official php.net source. The official tags landed the same day, so the build now uses the official php:8.6.0-fpm-alpine image, pinned by tag and digest, with nginx and php-fpm in front, running as www-data.
What is in it
PHP 8.6.0 with OPcache built in and tuned, plus pdo_pgsql, pdo_sqlite, intl, mbstring, zip, bcmath, pcntl, sockets, curl, openssl and sodium. Composer 2.9 ships in the image for your own dependencies. The demo app is dependency free: a status page and two JSON endpoints.
GET / status page, shows the running PHP version
GET /api/health {"status", "php", "opcache", "database"}
GET /api/info PHP 8.6 feature probes and loaded extensions
The health endpoint tells the truth about the database. It reports not_configured when no DATABASE_URL is set, ok only after a real query succeeds, and error with HTTP 503 when a configured database does not answer.
The new features, checked against the real runtime
The /api/info endpoint does not read the version string and print feature names. It probes the runtime with function_exists, class_exists and extension_loaded, so the flags it reports are real:
clamp($page, 1, 50) // keep a value inside a range
Time\Duration::fromSeconds(30) // a stopwatch style length of time
SortDirection::Ascending // one shared type for sort order
Io\Poll // one polling API across platforms
Try partial function application too. Call a function with only some of its arguments, put a ? where the missing ones go, and you get back a closure that waits for the rest.
Verified live, not just locally
A fresh deploy of this template on Railway went from build start to a passing healthcheck in about 1 minute 48 seconds on 20 November 2026. /api/health returned {"status":"ok","php":"8.6.0","opcache":true,"database":"not_configured"}, /api/info reported all four PHP 8.6 feature probes true, and the status page loaded. The test project was deleted right after verification.
One honest note. The database ok path, a live Postgres attached over DATABASE_URL, is still untested for this starter. The error path was verified against the earlier build. The README says that plainly.
The image is pinned to PHP 8.6.0 by digest on purpose, so a redeploy never changes your PHP version silently. Patch releases arrive as a one line bump in the Dockerfile. No variables are required to deploy. Add a Postgres service and set DATABASE_URL if you want the database path, then replace public/index.php with your own application.
Repo: https://github.com/AdeelAhmedKhan/php-86-starter-railway
Railway template: https://railway.com/deploy/php-86-starter
What are you building first on 8.6?
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.