What is Flight?

Flight is a fast, simple, extensible framework for PHP. It is quite versatile and can be used for building any kind of web application. It is built with simplicity in mind and is written in a way that is easy to understand and use.

Flight is a great beginner framework for those who are new to PHP and want to learn how to build web applications. It is also a great framework for experienced developers who want more control over their web applications. It is engineered to easily build a RESTful API, a simple web application, or a complex web application.

Quick Start

First install it with Composer

composer require flightphp/core

or you can download a zip of the repo here. Then you would 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?

Yes! Flight is fast. It is one of the fastest PHP frameworks available. You can see all the benchmarks at TechEmpower

See the benchmark below with some other popular PHP frameworks.

FrameworkPlaintext Reqs/secJSON Reqs/sec
Flight190,421182,491
Yii145,749131,434
Fat-Free139,238133,952
Slim89,58887,348
Phalcon95,91187,675
Symfony65,05363,237
Lumen40,57239,700
Laravel26,65726,901
CodeIgniter20,62819,901

Skeleton/Boilerplate App

There is an example app that can help you get started with the Flight Framework. Go to flightphp/skeleton for instructions on how to get started! You can also visit the examples page for inspiration on some of the things you can do with Flight.

Community

We're on Matrix Chat

Matrix

And Discord

Contributing

There are two ways you can contribute to Flight:

  1. You can contribute to the core framework by visiting the core repository.
  2. You can contribute to the documentation. This documentation website is hosted on . If you notice an error or want to flesh out something better, feel free to correct it and submit a pull request! We try to keep up on things, but updates and language translations are welcome.

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.