What is Flight?
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 experimenting with the latest AI-powered tools, Flight's low footprint and straightforward design make it a perfect fit.
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.
- AI Friendly: Flight's minimal overhead and clean architecture make it ideal for integrating AI tools and APIs. Whether you're building smart chatbots, AI-driven dashboards, or just want to experiment, Flight gets out of your way so you can focus on what matters. Learn more about using AI with Flight
Quick Start
First, 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.
Is it fast?
Absolutely! 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-powered projects. 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 |
Skeleton/Boilerplate App
There's an example app to help you get started with Flight. Check out flightphp/skeleton for a ready-to-go project, or visit the examples page for inspiration. Want to see how AI fits in? Explore AI-powered examples.
Community
Contributing
There are two ways you can contribute to Flight:
- Contribute to the core framework by visiting the core repository.
- 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.