Blog banner

FlightPHP-One of the fastest PHP frameworks

PHP is just a hammer. Nobody has ever gotten rich making hammers.

FlightPHP-One of the fastest PHP frameworks

PHP is just a hammer. Nobody has ever gotten rich making hammers.
Rasmus Lerdorf
Photo by Ben Griffiths on Unsplash

Table Of Content

  • What is FlightPHP?
  • Quick Start
  • Is it really fast?
  • Skeleton/Boilerplate App
  • FatFree-Slim vs FlightPHP
  • Making a conclusion

What is FlightPHP?

FlightPHP is a lightweight, high-performance, extensible PHP framework with ease of use and simplicity in mind. Its elegant architecture makes it excellent for building all types of web applications — from tiny websites to massive, involved, RESTful APIs.

Ideal for new PHP learners as well as seasoned programmers who want more control, Flight offers a clean, elegant approach to web development without sacrificing power or flexibility.

Full Documentation is https://docs.flightphp.com/en/v3/

Quick Start

First install it with Composer

composer require flightphp/core

Sample Hello World index.php application.

<?php

// Load Flight framework
// If installed via Composer
require 'vendor/autoload.php';

// If installed manually via zip (uncomment if needed)
// require 'flight/Flight.php';

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

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

// Route with dynamic message and optional query parameter
// (?messageid=...)
Flight::route('GET /echo/@message', function ($message) {
$query = Flight::request()->query;
$messageId = $query['messageid'] ?? '';
echo "$message => MessageId: $messageId";
});

// Start the application
Flight::start();

Is it really 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.

FlightPHP is genuinely fast Why ?

  • Micro-framework: Flight is a minimalist framework, meaning it doesn’t come with heavy abstractions or unnecessary layers. Less code = faster execution.
  • No dependency injection container or service providers like Laravel or Symfony, which can introduce overhead.
  • Simple routing and request handling keep performance tight.
  • Lightweight footprint: Very few files, no ORM, no templating engine by default — giving you control and less bloat.
  • Full framework (manual ZIP download):
     ~60 KB (unzipped)
     ~20–30 KB (zipped)
  • Via Composer (including metadata):
     vendor/flightphp/coretakes up around 150 KB total.

Skeleton/Boilerplate App

Use this skeleton application to quickly setup and start working on a new Flight PHP application. This application uses the latest version of Flight PHP v3.

This skeleton application was built for Composer. You also could download a zip of this repo, downloading a zip of the flightphp/core repo, and manually autoload the files by running require('flight/autoload.php') in your app/config/bootstrap.php file.

Installation

Run this command from the directory in which you want to install your new Flight PHP application. (this will require PHP 7.4 or newer)

composer create-project flightphp/skeleton cool-project-name

Replace cool-project-name with the desired directory name for your new application.

After you create the project, make sure you go to the app/config/config.php and app/config/services.php and uncomment the lines related to the database you want to use before you get started.

Note: If you are installing with PHP 8.0 or above and want to use tracy-extensions be sure to run composer require --dev flightphp/tracy-extensions "^0.2" after the project is created.

Running the Application

No Dependency Setup

To run the application in development, you can run these commands

cd cool-project-name
composer start

After that, open http://localhost:8000 in your browser.

  • Also Docker Setup and Vagrant Setup exist .

FatFree-Slim vs FlightPHP

3 popular lightweight PHP micro-frameworks. Lets compare them

Compare Result

Summary Recommendations

  • FlightPHP: Use if you require something very lightweight, fast, and easy to understand. Best for APIs or utilities where simplicity is paramount.
  • Slim: Best for more structured REST APIs, with PSR-7 support, middleware, and strong community plugins. More “modern PHP”.
  • Fat-Free Framework (F3): A gem in disguise. Offers more built-in utilities (routing, templating, DB, caching) in a single file. Nice balance of simplicity and power.

Also, in one of my documents, I was comparing the Fat-Free and Slim frameworks in detail.

Making a conclusion

👨‍👦‍👦 Leave a comment, I am free for discussion with your any kind technical question.

#FlightPHP #PHP #MicroFramework #WebDevelopment #RESTAPI #Performance #OpenSource #TechBenchmarks #PHPFrameworks #SoftwareDevelopment

Version 1.0.1