Hi everyone,
Yes, I know. PHP was built for request/response: a request comes in, a response goes out, then the process dies. A game needs a loop that runs 60 times per second, with input, audio, rendering and sometimes threads. That is pretty much the opposite.
I wanted to see how far PHP could go anyway. The result is JumPHP: https://jumphp.net/
It's a platform for building games in pure PHP. Games are hosted automatically and run directly in the browser, on desktop and mobile.
How it works under the hood
- One codebase, two targets. On desktop, it runs on PHP + SDL2 in a native window. In the browser, PHP is compiled to WebAssembly. The game code is the same for both.
- A real game loop. The engine calls update($dt) then render($r) around 60 times per second. Coordinates are virtual pixels, scaled to the screen.
- WebGL driven from PHP. 3D cubes and post-processing shaders (CRT, wave, 4-color palette).
- Threads in PHP. One demo renders a fractal with a pool of PHP threads (TrueAsync).
- A structure that will feel familiar. It looks a lot like a web framework:
games//
config/game.yaml # title, resolution (e.g. 320x180), first scene
config/input.yaml # actions mapped to keyboard, gamepad, touch
src/Scene/.php # title screen, gameplay, pause...
src/Entity/.php # player, enemies...
assets/ # sprites, sounds, music, levels
If you've worked with Symfony or Laravel, you'll find your way around quickly.
Four ways to make a game
- From an Amstrad CPC disk image. Provide the .dsk file and the game is rebuilt in PHP. That's how the Rainbow Islands remake was made (7 islands, 28 rounds).
- From an open source game. Port C, Pascal or BASIC sources to PHP. Moktar runs on a PHP port of the OpenTitus engine with the original data files. Sapiens, a French adventure game from 1986, was ported from its GPL v3 C sources.
- From scratch, writing the code yourself.
- From a Claude prompt. Describe your game in a few sentences. Claude, connected to the platform through an MCP server, writes the PHP, tests it, builds the game's page and publishes it. The framework contract is documented in an AGENTS.md file in the repo.
No lock-in: your game is your repo
No lock-in: your game is your repo
This is the part I care about most. Your game lives in a public GitHub repository under your account. Every push goes live in about a minute. You keep full control and can take your code wherever you want.
I've done it with my own Sonic. It started as a Master System remake. Since then I've added multiplayer, ghosts, best times and races against AI runners.
You can also fork any existing game and change it.
Playable now, no account needed: Sonic PHP, Rainbow Islands, Moktar, Sapiens, Breakout, Pong (with online play), a 3D runner and a few tech demos.
Coming soon: custom domains for your games.
It works in any modern browser. Not IE6, sorry.
Source code:
- Engine: https://github.com/davidnurdin/jumPhp
- Platform: https://github.com/davidnurdin/jumphp-playground
Three things I'd like your input on:
- PHP on WASM for real-time apps: is this a viable direction for the language, or a fun hack that should stay one? If you know the WASM or php-src internals well, I'd like your take on the architecture.
- The engine API: read the code and tell me what you'd design differently. Scenes and entities, input mapping, the update/render contract. Be honest.
- Testing: try to break it. Frame drops, mobile bugs, weird browser behavior, I want to hear about all of it.
And if there's a retro game you'd like to see rebuilt in PHP, drop it in the comments.
PS: please don't insult me too much.
https://jumphp.net/ : your PHP game studio.

Top comments (0)