CONCEPT
What php2go is
php2go is a compiler and managed build service for PHP projects. It analyzes source code, generates Go code, links a compatibility runtime, and builds an executable binary that can run without PHP-FPM.
What the compiler does
- Reads PHP files, classes, functions, require/include calls, and Composer autoload.
- Understands types, arrays, object properties, method calls, and common PHP patterns.
- Generates Go code and replaces PHP runtime calls with direct Go where it is safe.
- Builds a binary, manifest, logs, and run instructions into one artifact.
What it is not
- It is not a PHP interpreter and not a wrapper around php-fpm.
- It does not magically rewrite business logic into another framework.
- It is not shell access to the server: commands are limited and validated.
- It does not promise that every arbitrary PHP project builds without diagnostics.
Why it is useful
The main value is a portable deploy artifact, faster legacy-code checks, less dependency on the PHP environment, and visible compatibility problems before production.