Flight PHP Framework

Flight is a fast, simple, extensible framework for PHP—built for developers who want to get things done quickly, with zero fuss. Whether you're building a classic web app, a blazing-fast API, or pairing with AI coding assistants, Flight's low footprint and straightforward design make it a perfect fit. Flight is meant to be lean, but can also handle enterprise architecture requirements.

Why Choose Flight?

  • Beginner Friendly: Flight is a great starting point for new PHP developers. Its clear structure and simple syntax help you learn web development without getting lost in boilerplate.
  • Loved by Pros: Experienced devs love Flight for its flexibility and control. You can scale from a tiny prototype to a full-featured app without switching frameworks.
  • Backwards Compatible: We value your time. Flight v3 is an augmentation of v2, keeping almost all of the same API. We believe in evolution, not revolution—no more "breaking the world" every time a major version comes out.
  • Zero Dependencies: Flight's core is completely dependency-free—no polyfills, no external packages, not even PSR interfaces. This means fewer attack vectors, a smaller footprint, and no surprise breaking changes from upstream dependencies. Optional plugins may include dependencies, but the core will always stay lean and secure.
  • AI Friendly: Flight's small API surface and the official skeleton (one layout, AGENTS.md, constructor injection) make it easy for AI coding tools to stay on-pattern. Same codebase whether you type every line or pair with an agent. Learn more about using AI with Flight.

Video Overview

Simple enough, right?

Learn more about Flight in the documentation!

Quick Start

To do a fast bare bones install, install it with Composer:

composer require flightphp/core

Or you can download a zip of the repo here. Then you'd have a basic index.php file like the following:

<?php

// if installed with composer
require 'vendor/autoload.php';
// or if installed manually by zip file
// require 'flight/Flight.php';

Flight::route('/', function() {
  echo 'hello world!';
});

Flight::route('/json', function() {
  Flight::json([
    'hello' => 'world'
  ]);
});

Flight::start();

That's it! You have a basic Flight application. You can now run this file with php -S localhost:8000 and visit http://localhost:8000 in your browser to see the output.

Short Flight:: examples like this are great for learning and micro apps. For a full project layout that humans and AI tools share, use the skeleton below.

Skeleton/Boilerplate App

There's an official starter to help you begin any new Flight project. It sets up structure, config, Composer scripts, and AI-friendly instructions out of the gate.

Check out flightphp/skeleton for a ready-to-go project, or visit the examples page for inspiration. Want the AI workflow details? Explore AI & developer experience.

What you get (high level):

  • App\ namespaces with PascalCase folders (app/Controller/, app/Middleware/, app/Model/, …)—folder case must match the namespace (see Autoloading)
  • Dice + Engine injection so controllers stay testable (prefer $this->app over Flight:: in app code)
  • Twig views, SimplePdo + ActiveRecord sample, Runway migrate
  • Root AGENTS.md (plus scoped copies) and SECURITY.md for assistants and security policy

Installing the Skeleton App

Easy enough!

# Create the new project
composer create-project flightphp/skeleton my-project/
# Enter your new project directory
cd my-project/
# Bring up the local dev-server to get started right away!
composer start

It creates the project structure, copies config_sample.phpconfig.php (and .env.example.env when present), and you're ready to go. Optional sample data:

php runway migrate
# then visit /posts and /api/posts

High Performance

Flight is one of the fastest PHP frameworks out there. Its lightweight core means less overhead and more speed—perfect for both traditional apps and modern AI-assisted workflows. You can see all the benchmarks at TechEmpower

See the benchmark below with some other popular PHP frameworks.

Framework Plaintext Reqs/sec JSON Reqs/sec
Flight 190,421 182,491
Yii 145,749 131,434
Fat-Free 139,238 133,952
Slim 89,588 87,348
Phalcon 95,911 87,675
Symfony 65,053 63,237
Lumen 40,572 39,700
Laravel 26,657 26,901
CodeIgniter 20,628 19,901

Flight and AI

Curious how Flight pairs with coding LLMs? Discover how AGENTS.md, Runway ai:* commands, and the skeleton layout keep assistants on the rails.

Stability and Backwards Compatibility

We value your time. We've all seen frameworks that completely reinvent themselves every couple of years, leaving developers with broken code and expensive migrations. Flight is different. Flight v3 was designed as an augmentation of v2, which means that the API you know and love hasn't been stripped away. In fact, most v2 projects will work without any changes in v3.

We're committed to keeping Flight stable so you can focus on building your app, not fixing your framework. The skeleton can be opinionated for new projects; core APIs stay familiar for everyone else.

Community

We're on Matrix Chat

Matrix

And Discord

Contributing

There are two ways you can contribute to Flight:

  1. Contribute to the core framework by visiting the core repository.
  2. Help make the docs better! This documentation website is hosted on Github. If you spot an error or want to improve something, feel free to submit a pull request. We love updates and new ideas—especially around AI and new tech!

Requirements

Flight requires PHP 7.4 or greater.

Note: PHP 7.4 is supported because at the current time of writing (2024) PHP 7.4 is the default version for some LTS Linux distributions. Forcing a move to PHP >8 would cause a lot of heartburn for those users. The framework also supports PHP >8.

License

Flight is released under the MIT license.