PHPackages                             quillphp/quill - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. quillphp/quill

ActiveLibrary[Framework](/categories/framework)

quillphp/quill
==============

Quill — High-performance PHP 8.3+ API framework. Boot once, serve forever.

0.0.2(3mo ago)01002MITPHPPHP ^8.3CI passing

Since Apr 5Pushed 2mo agoCompare

[ Source](https://github.com/quillphp/quill)[ Packagist](https://packagist.org/packages/quillphp/quill)[ Docs](https://quillphp.com)[ RSS](/packages/quillphp-quill/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (7)Versions (4)Used By (2)

QuillPHP
========

[](#quillphp)

**High-performance PHP 8.3+ API framework — boot once, serve forever.**

[![CI](https://github.com/quillphp/quill/actions/workflows/ci.yml/badge.svg)](https://github.com/quillphp/quill/actions/workflows/ci.yml)[![PHP](https://camo.githubusercontent.com/d484c54a084d8bbc711346c7013fb53a0afa2a3c4586d2c663a3f96214e95f75/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e332d3737376262342e737667)](https://php.net)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

### [Quick Start](.github/docs/getting-started.md) • [Benchmarks](.github/docs/benchmarks.md)

[](#quick-start--benchmarks)

---

The Quill Philosophy
--------------------

[](#the-quill-philosophy)

QuillPHP is a **binary-native** API framework built for extreme low-latency environments. The key insight is simple: **PHP never touches a socket.**

The native **Quill Core** (Rust + Axum + Tokio) owns the entire I/O stack — TCP connections, route matching, DTO validation, and response serialisation. PHP is woken up only to run your handler, then goes back to polling. By strictly separating a one-time **Boot Phase** from a zero-overhead **Hot Path**, Quill reaches throughput that rivals compiled languages without leaving PHP.

### Performance: Industry Benchmarks (TFB R22)

[](#performance-industry-benchmarks-tfb-r22)

*Hardware: 48-core AMD EPYC 7R13, 512 connections. Source: [TechEmpower Round 22 JSON](https://www.techempower.com/benchmarks/#hw=ph&test=json&section=data-r22).*

FrameworkThroughput (req/s)Avg LatencyActix-web 4 (Rust)~450,000~0.22 msAxum 0.7 (Rust / Tokio)~330,000~0.30 msGo Fiber v2 (fasthttp)~220,000~0.45 msGo net/http (stdlib)~115,000~0.87 msNode.js Fastify v4~68,000~1.47 msNode.js Express v4~18,000~5.56 msFastAPI + Uvicorn~11,000~9.09 ms### Performance: Direct Local Measurement

[](#performance-direct-local-measurement)

*Hardware: Apple M-series (ARM64), 100 connections.*

FrameworkThroughput (req/s)Avg LatencyNotes**QuillPHP (Native)****133,627****1.16 ms**`wrk` on macOS¹FrankenPHP (worker)~30,000~3.33 msEstimated²Laravel Octane (Swoole)~10,000~10.0 msBare route³> ¹ **QuillPHP measurement** — `wrk -t4 -c100 -d10s`, `QUILL_WORKERS=4`, macOS 14.4+, PHP 8.3 (NTS), Rust core built with `--release`.
>
> ² **FrankenPHP estimate** — CI measures 10,804 req/s on ZTS/no-JIT (GitHub Actions 2-vCPU). NTS + JIT is documented at 2–3× that figure.
>
> ³ **Laravel Octane** — Bare `Route::get('/hello', fn() => [...])` with no sessions, DB, or auth middleware in a production-optimised build.

---

Feature Highlights
------------------

[](#feature-highlights)

- **Axum / Tokio HTTP Server** — All TCP I/O runs inside a dedicated single-threaded Tokio runtime per worker, fully bypassing PHP's process model.
- **matchit Radix Trie Router** — Routes are compiled into a native radix trie at boot; every request dispatches in O(log n) with zero PHP involvement.
- **Zero-Reflection Hot Path** — Handler parameter maps are built once at boot via reflection and cached; the hot path does a single array lookup per argument.
- **Native DTO Validation** — Schema checks run inside the Rust `ValidatorRegistry` before PHP is polled — invalid requests are rejected with a 400 without touching userland.
- **Multi-Worker via `pcntl_fork`** — The TCP port is pre-bound once, then forked N times. Each worker owns an independent Rust heap with no shared state.
- **sonic-rs SIMD JSON** — JSON compaction and encoding accelerated by `sonic-rs` across the FFI boundary.
- **OpenAPI 3.0** — Automatic Swagger UI generation directly from your route and DTO definitions.

---

Architecture
------------

[](#architecture)

Quill enforces a hard boundary between the **Boot Phase** (reflection, compilation, registration) and the **Hot Path** (pure dispatch). The native core owns all I/O; PHP only runs your business logic.

### Multi-Worker Model

[](#multi-worker-model)

Routes are compiled into a native manifest and the TCP port is pre-bound **before** `pcntl_fork`. Each worker independently re-initialises its Rust heap so there is zero shared state across processes.

 ```
flowchart TD
    A["routes.php"] -->|"$app->get / post / ..."| B["App::boot()"]
    B -->|"Router::compile()"| C["Route Manifest JSON"]
    B -->|"Validator::register()"| E["DTO Schema JSON"]

    C -->|"FFI → quill_router_build()"| RT[(matchit\nradix trie)]
    E -->|"FFI → quill_validator_register()"| VL[(ValidatorRegistry)]
    B -->|"FFI → quill_server_prebind(port)"| Sock[[Shared Socket fd]]

    Sock -.->|"dup(2) per worker"| W1 & W2 & WN

    subgraph W1 ["Worker 1 — parent process"]
        direction LR
        QC1["Quill Core\n(Axum / Tokio)"] |"FFI bridge"| PH1[PHP Poll Loop]
    end
    subgraph W2 ["Worker 2 — pcntl_fork"]
        direction LR
        QC2["Quill Core\n(Axum / Tokio)"] |"FFI bridge"| PH2[PHP Poll Loop]
    end
    subgraph WN ["Worker N — pcntl_fork"]
        direction LR
        QCN["Quill Core\n(Axum / Tokio)"] |"FFI bridge"| PHN[PHP Poll Loop]
    end
```

      Loading ### Request Lifecycle

[](#request-lifecycle)

 ```
sequenceDiagram
    participant C  as Client
    participant QC as Quill Core (Axum / Tokio)
    participant RT as matchit Router
    participant VL as ValidatorRegistry
    participant PL as PHP Poll Loop
    participant RM as RouteMatch
    participant H  as Your Handler

    C->>+QC: HTTP Request

    QC->>RT: match_route(method, path)
    RT-->>QC: { handler_id, params, dto_class }

    opt dto_class present
        QC->>VL: validate(body_bytes)
        VL-->>QC: typed data  —or—  400 Bad Request
    end

    QC->>PL: quill_server_poll() → PendingRequest
    PL->>RM: RouteMatch::execute($request)
    RM->>RM: resolve args from param cache
    RM->>H: $handler(...$args)
    H-->>RM: array | HttpResponse
    RM-->>PL: result
    PL->>QC: quill_server_respond(id, json)

    QC->>QC: parse { status, headers, body }
    QC-->>-C: HTTP Response
```

      Loading > Each worker's param cache is built **once** at boot via reflection and never touched again — zero reflection on the hot path.

---

Getting Started
---------------

[](#getting-started)

### 1. Installation

[](#1-installation)

```
composer create-project quillphp/quill my-api
cd my-api
```

### 2. Define Your Routes

[](#2-define-your-routes)

```
// routes.php
use Handlers\User\ListUsersAction;
use Handlers\User\CreateUserAction;

/** @var \Quill\App $app */

// Simple closure — zero dependencies
$app->get('/hello', fn() => ['message' => 'hello', 'status' => 'ok']);

// Class-based handler — JIT-friendly, stable param-cache key
$app->get('/users',  [ListUsersAction::class, '__invoke']);
$app->post('/users', [CreateUserAction::class, '__invoke']); // auto-validates DTO
```

### 3. Serve

[](#3-serve)

```
# Single worker
php -d ffi.enable=on bin/quill serve

# Multi-worker (recommended for production)
QUILL_WORKERS=4 php -d ffi.enable=on bin/quill serve --port=8080
```

---

In-Depth Guides
---------------

[](#in-depth-guides)

- [**Architecture**](.github/docs/architecture.md) — Boot phase, hot path, and the FFI bridge in detail.
- [**Routing**](.github/docs/routing.md) — Verb mapping, groups, resource routes, and path parameters.
- [**Validation**](.github/docs/validation.md) — DTOs, PHP attributes, and native schema validation.
- [**Benchmarks**](.github/docs/benchmarks.md) — Methodology, hardware specs, and full comparison results.

---

Contributing
------------

[](#contributing)

We welcome contributions! Please see our [Contributing Guide](.github/docs/development.md) for local setup instructions.

License
-------

[](#license)

QuillPHP is open-source software licensed under the **[MIT License](LICENSE)**.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance84

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

90d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4742b2ad737c14793d6b0a418e6da90b446153a4d7ba120a1f3c07e2a2951d28?d=identicon)[quillphp](/maintainers/quillphp)

---

Top Contributors

[![fr3on](https://avatars.githubusercontent.com/u/26393383?v=4)](https://github.com/fr3on "fr3on (73 commits)")

---

Tags

apifastframeworkmicroopenapiphprestphpapiframeworkrestmicroopenapifast

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/quillphp-quill/health.svg)

```
[![Health](https://phpackages.com/badges/quillphp-quill/health.svg)](https://phpackages.com/packages/quillphp-quill)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[cakephp/cakephp

The CakePHP framework

8.9k19.5M1.8k](/packages/cakephp-cakephp)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[api-platform/state

API Platform state interfaces

274.9M136](/packages/api-platform-state)[zemit-cms/core

Build Phalcon REST APIs faster with database-first scaffolding, model relationships, eager loading, identity, permissions, CLI, and WebSocket support.

148.5k1](/packages/zemit-cms-core)[doppar/framework

The Doppar Framework

4012.4k14](/packages/doppar-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
