PHP in.
Native binary out.
Manticore compiles PHP 8.5+ to standalone arm64 and x86_64 binaries through LLVM. No interpreter, no php.ini, no extension loader. The compiler is written in PHP and compiles itself to a byte-identical fixpoint.
manticore compile app.php -o app && ./appLatest release v0.17.0
Same bytes as Zend
The Zend interpreter is the oracle. If php runs a program, the native binary prints the same output. Every plain-runnable test case is diffed against it.
Faster, smaller
| Case | Native | PHP | Speedup |
|---|---|---|---|
fib | 0.13 s | 13.61 s | 104.7× |
generator_yield | 0.03 s | 0.91 s | 30.3× |
closures | 0.03 s | 0.79 s | 26.3× |
array | 0.09 s | 1.00 s | 11.1× |
json | 0.05 s | 0.25 s | 5.0× |
More than PHP
- Structured concurrency
- FFI to any C library
- Modules and compile-time attributes
- HTTP, WebSocket, PDO
Install
curl -fsSL https://raw.githubusercontent.com/manticorephp/compiler/main/install.sh | bash
export PATH="$HOME/.manticore/bin:$PATH"
manticore versionmacOS and Linux (glibc and musl), arm64 and x86_64.