---
title: "PHP can run DOOM. And in several ways"
url: https://www.exakat.io/php-can-run-doom-and-in-several-ways/
date: 2026-11-02
modified: 2026-11-02
lang: en
author: "dams"
description: "PHP can run DOOM. And in several ways Can it run DOOM? is the internet's oldest benchmark. Printers, thermostats, pregnancy tests: if it has a CPU, someone has ported DOOM..."
categories:
  - "Technology"
tags:
  - "game"
  - "php"
image: https://www.exakat.io/wp-content/uploads/2026/11/toy.640.jpg
word_count: 1642
---

# PHP can run DOOM. And in several ways

# PHP can run DOOM. And in several ways

`Can it run DOOM?` is the internet's oldest benchmark. Printers, thermostats, pregnancy tests: if it has a CPU, someone has ported DOOM to it. PHP, the language of personal home page counters and extensive frameworks, is no exception. In fact, DOOM is also the de facto "Hello World" of the PHP gaming scene: nearly every time someone builds a new way for PHP to touch pixels, DOOM arrives within months as proof of concept.

But PHP games are far more than DOOM clones. From a 21,000-line Sonic remake running at 60 fps in your browser, to a classic trading game rebuilt in your terminal, to the massive browser strategy games that once ruled the web, there is a wide ranging panorama of PHP games. Let's review them, organized by the underlying technology that makes them possible.

And yes, we'll check at every step: how does DOOM fit here too?

## 1. php-sdl: Sonic, Running at 60 FPS

### The games:

- [**Sonic the Hedgehog (Master System remake)**](https://github.com/davidnurdin/sonicGamePhp): a fan remake of the 1991 classic, ~21,000 lines of pure PHP, running at 60 fps with online multiplayer for up to 6 players (race, flag, rings, deathmatch). [Repository](https://github.com/davidnurdin/sonicGamePhp) · [Play it in the browser](https://davidnurdin.github.io/php-wasm-sdl/)
- [**sonic-jumphp**](https://github.com/davidnurdin/sonic-jumphp): the same game ported to the [JumPHP](https://jumphp.net/?lang=en) runtime ([repository](https://github.com/davidnurdin/jumPhp)). [Repository](https://github.com/davidnurdin/sonic-jumphp)
- The same author's PHP-compiled-to-WASM retro arcade: **Rainbow Islands, Moktar, Sapiens, Breakout, Pong (with online play), a 3D runner** ([write-up](https://dev.to/mimi_chat_b3bf7a39a962a82/php-games-create-and-remix-retro-games-or-build-your-own-php-compiled-to-webassembly-running-320f)).

### What makes php-sdl work

[php-sdl](https://github.com/davidnurdin/php-wasm-sdl) is a PHP extension for [**SDL2**](https://www.libsdl.org/), the same C library that powers countless native games. PHP was built for request/response: a request comes in, a response goes out, the process dies. SDL2 inverts that: the game holds a native window open, and PHP runs a continuous game loop: `Game.php` orchestrates the scene, camera, HUD, tilesets, physics and replays. The masterstroke is the second target: PHP 8.3 itself is compiled to WebAssembly with Emscripten, alongside an SDL2 extension, so the exact same PHP code runs in the browser: SDL2 renders to WebGL, sound goes through Web Audio, saves live in IndexedDB. One codebase, desktop and mobile.

### Where does DOOM fit? php_doom is Doomgeneric, the deliberately portable DOOM skeleton, ported to 100% PHP source with SDL2. Same library, same rendering model as Sonic. When a new SDL binding for PHP appears, DOOM is rarely far behind.

## 2. PHP-GLFW / VISU: OpenGL for PHP

### The games:

- [**FlappyPHPant**](https://visu.phpgl.net/games/flappyphpant.html): a Flappy Bird-like where you are an elephant with wings flying through pipes.
- [**Mining PHPotentials**](https://github.com/phpgl/php-craft): a Minecraft-inspired game written in PHP. [Repository](https://github.com/phpgl/php-craft)
- The whole catalog lives on the [VISU PHP games list](https://visu.phpgl.net/games/0-php-games.html).

### What makes php-glfw work

[**PHP-GLFW**](https://github.com/mario-deluna/php-glfw) binds PHP to [**GLFW**](https://www.glfw.org/) and OpenGL, giving PHP a real GPU pipeline: vertex buffers, shaders, textures. On top of it sits [**VISU**](https://visu.phpgl.net/), a game framework with scene management, vector math, input handling and a drawing context. Think about it as a tiny game engine, in PHP. The maintainers actively collect example games because, as they put it, example code is the best way to learn a framework. Even in these times of AI.

### Where does DOOM fit?

Almost by definition. SerafimArts' [**PHP-Doom**](https://github.com/SerafimArts/PHP-Doom) takes the same idea one level deeper: pure PHP, with built-in extensions only, driving the [**Vulkan API**](https://www.vulkan.org/), with ray tracing. DOOM's 1993 level geometry lit by a 2020s rendering technique, from PHP. If VISU doesn't have a DOOM port yet, it's clearly only a matter of time: and that's an open invitation.

## 3. FFI: DOOM, Three Different Ways

### The games:

- [**dumm**](https://github.com/nawarian/dumm) — a DOOM port to PHP using FFI and Raylib. [Repository](https://github.com/nawarian/dumm)
- [**php_doom**](https://github.com/vagucs/php_doom) — see above; SDL2 through PHP bindings. [Repository](https://github.com/vagucs/php_doom)
- [**elephc/doom**](https://github.com/getelephc/doom): DOOM rendered in PHP and compiled to a native binary by [elephc](https://elephc.dev/), a PHP-to-native compiler written in Rust ([repository](https://github.com/illegalstudio/elephc)). [Show HN discussion](https://news.ycombinator.com/item?id=47628079)

### What makes FFI work

PHP's FFI, the Foreign Function Interface, extension lets PHP call C libraries directly, such as Raylib, SDL2, Vulkan, without writing a PHP extension in C. This is the pragmatic middle path: all game logic in PHP, all heavy rendering in battle-tested native code, glued at runtime. The elephc project goes further: instead of calling native code from PHP, it compiles PHP to native code, and renders DOOM E1M1 in real time: BSP traversal, perspective projection, distance fog, sector lighting, collision detection, all written in PHP, running at 15+ FPS.

### Where does DOOM fit?

This is the DOOM category. FFI is the technology that made `PHP runs DOOM` true, and every new low-level binding gets validated the same way.

## 4. Plain Old BBS-Style: The Games PHP Was Born For

### The games:

- [**Legend of the Green Dragon (LotGD)**](https://github.com/lotgd/lotgd): the classic text MMORPG, web successor to the BBS legend `Legend of the Red Dragon`. [Repository](https://github.com/lotgd/lotgd)
- [**BlackNova Traders**](https://sourceforge.net/projects/blacknova/): space exploration and trading, inspired by the BBS staple TradeWars. [Home page](https://sourceforge.net/projects/blacknova/)
- [**OpenDominion**](https://github.com/WaveHack/opendominion): a persistent browser strategy game. [Repository](https://github.com/WaveHack/opendominion) · [Wiki](https://wiki.opendominion.net/wiki/OpenDominion)
- The **2Moons / XG-Project** family: open-source engines for building OGame-style strategy worlds ([archive list](https://github.com/DocKob/PHP-Games-Archives)). The 2Moons engine is on [GitHub](https://github.com/jkroepke/2Moons/), where it describes itself as an open source browser game framework. The repository is archived. XG-Project has since moved to Laravel: [XGProyect](https://github.com/XGProyect/XGProyect).

### What makes BBS work:

Nothing but PHP + MySQL, and that's the point. These are persistent browser-based games (PBBGs): every action is a form submission, every page load is a turn, sessions track the player. PHP's share-nothing request/response model, though fatal for a platformer, is a perfect match for a game where the world persists in the database between clicks. This genre produced the most popular PHP games ever, back when OGame and its clones commanded hundreds of thousands of players.

### Where does DOOM fit?

Well, you won't believe me: it doesn't fit in this section. DOOM is real-time first-person action; a request/response turn loop cannot express it. The best you could do is a turn-based `DOOM MUD`, which would be a different game wearing the license. Every category has its emblematic game because of what the technology cannot do: here, LotGD rules precisely where DOOM can't follow. Don't even try it at home!

## 5. TUI Games: Taipan! in Your Terminal

### The games:

- [**Taipan! (2026 PHP rebuild)**](https://www.exakat.io/rebuilding-taipan-with-an-ai-pair-programmer-in-php/): a faithful rebuild of the classic Apple II trading game, buy low in Hong Kong, sell high, dodge pirates, take on Brother Wu loans at brutal interest. Playable right now: clone the [repository](https://github.com/dseguy/taipan) and run `php bin/taipan`. Notably co-built with an AI pair programmer, with the human's real job shifting from writing code to playing the game to find what felt wrong.
- [**velkuns/game-text-engine**](https://github.com/velkuns/game-text-engine): a PHP engine for building text games, with choices, items and more. [Repository](https://github.com/velkuns/game-text-engine)

### What makes TUI work:

Plain PHP CLI, like `php bin/taipan`, and you're trading opium in 19th-century China. PHP can use ncurses through an optional PECL extension, and can emit raw ANSI escape codes (colors, cursor positioning), though for games like Taipan the line-by-line terminal output of the original barely needs them. The game loop runs in a long-lived CLI process with `fgets(STDIN)` for input: again a small heresy for PHP, and again entirely workable.

### Where does DOOM fit?

It doesn't fit. Or, more precisely, not yet: but it could. Raycasting is just math; an ASCII rendering of E1M1 through `@`, `#` and `.` characters driven by ncurses is entirely feasible in PHP. Nobody has done it. If you build it, the panorama gets its final cell filled: so, challenge accepted?

## 6. JavaScript-Based Games: PHP as the Dungeon Master

### The games:

- [**Azimutant** (formerly InvaZion)](https://github.com/Nadawoo/invazion): a collaborative strategy game inspired by Hordes.fr/Die2Nite.
- [**Ultimate Warfare**](https://ultimate-warfare.com/): an online multiplayer strategy game, modernized to PHP + Symfony. [Repository](https://github.com/FrankProjects/UltimateWarfare)
- [**La Villa del Seis**](https://github.com/jalbam/lavilladel6) and [**Yasmina's Quest**](https://github.com/jalbam/yquest): point-and-click + text adventures entirely in PHP and DHTML. Home pages: [La Villa del Seis](https://sourceforge.net/projects/lavilladel6/) · [Yasmina's Quest](https://sourceforge.net/projects/yquest/).

### What makes it work:

The classic division of labor: all rendering in the browser, with Canvas, WebGL or Three.js; all authority on the server. PHP validates every move, persists the world in MySQL, runs the combat math, and exposes it over AJAX or WebSockets ([Workerman](https://www.workerman.net/) is a popular PHP socket server for real-time titles). High scores, anti-cheat, multiplayer matchmaking: that's PHP's home turf. The medium article "[Building a 2D game in PHP: makes no sense, but it works](https://medium.com/@annxsa/building-a-2d-game-in-php-makes-no-sense-but-it-works-b92e77a25bac)" captures the spirit: keep the logic server-side where PHP lives, send only player input from the client.

### Where does DOOM fit?

It fits in a specific role: PHP parses the WAD, holds the game state and referees multiplayer while JavaScript/WebGL does the drawing. And the WASM route blurs the line entirely, just as Sonic proved. PHP compiled to WebAssembly is the client.

## PHP Is The Beast Of The Game

There is one more category where PHP quietly dominates, and where it has nothing to do with rendering: applications that manage games. If you run a Minecraft, Rust, CS:GO or Garry's Mod server, the ecosystem around you is largely PHP:

- [**Pterodactyl**](https://pterodactyl.io/): the free, open-source game server management panel, made with Laravel + Docker, and its fork [**Pelican**](https://pelican.dev/).
- [**Azuriom**](https://azuriom.com/): a complete open-source web solution for game servers, complete with CMS, forums, store, player profiles, and trusted by thousands of servers and millions of players.
- [**H2O Game**](https://github.com/pH-7/H2OGame) and various PHP arcade scripts: ready-made platforms to run your own games portal.

This approach feels more familiar: PHP may be an outsider as a game language, but as a game-adjacent language to manage any piece of data, with panels, dashboards, leaderboards, stores, wikis, community sites, it's the industry standard. DOOM itself would feel at home: even if PHP couldn't render a single imp, it would happily run the tournament bracket, the server browser, and the mod repository.

## PHP player has entered the game

So, can PHP run DOOM? On SDL, OpenGL, Vulkan, FFI and WebAssembly: yes, it already does. In a terminal: not yet, and that sounds like an open PR waiting to happen.

If you build the missing ASCII DOOM in PHP, or any PHP game at all, drop me a note! I want to play it!