Introduction

Welcome to Fast! If you have ever wished PHP could stay warm between requests, handle thousands of live connections, and still read like the plain, boring PHP you already know, you are in the right place.

Fast is a small, dependency-free web framework built on an event loop with a persistent worker model. It boots your application once and keeps it in memory, so you skip the cold start that traditional PHP pays on every single request.

What makes Fast different

Most PHP setups throw your whole application away after each request and rebuild it from scratch on the next one. That is simple, but it is also wasteful. Fast takes a different path, and it rests on three ideas.

First, there are no dependencies. No Composer, no PSR interfaces, no vendored libraries. Fast is pure PHP 8.5 using only the standard extensions that ship with the CLI (sockets, pcntl, and posix). You clone it, you run it, you are done.

Second, Fast uses fibers instead of callbacks. Your handlers read as flat, top-to-bottom code. When something would block, like a database query, the event loop quietly parks that fiber and goes off to serve other connections. There are no promise chains and no callback pyramids to reason about, just ordinary code that happens to be non-blocking underneath.

Third, Fast runs persistent workers without the leaks. Workers recycle themselves after a set number of requests or once they cross a memory ceiling, and every request runs inside a throwaway container scope. That means per-request state simply cannot pile up over time, even though the process itself lives on.

A tiny example

Here is a complete Fast application. Register your routes, then call serve():

require __DIR__ . '/bootstrap.php';

get('/', fn (): string => 'Hello.');
get('/api', fn (): array => ['ok' => true]);
get('/user/{id}', fn () => json(['id' => request()->attribute('id')]));

serve(port: 8080, workers: 4);

A handler that returns a string becomes an HTML response. Return an array and Fast sends JSON. Need more control? Return a Response object and it goes out exactly as you built it. That is the whole mental model.

Who Fast is for

Fast is a low-level framework. It hands you routing, a container, a database layer, sessions, real-time streams, and a validation library, then gets out of your way. If you like understanding the machine you are running on, and you want the speed of a long-lived process without adopting a heavyweight async ecosystem, Fast will feel like home.

Fast targets PHP 8.5 and above on the CLI SAPI. You will want the sockets, pcntl, and posix extensions, which come bundled with the CLI on Linux, macOS, and BSD. Windows support is covered later in the Runtime section.

Ready to run something? Head to Installation next.