Repository navigation
Manticore 0.6.0
Manticore is a PHP-to-native AOT compiler written in PHP — and it compiles itself. It turns a large subset of PHP 8.5 into standalone, statically-linked arm64/x86_64 binaries via LLVM, with no PHP runtime in the output.
This is the first tagged release: the point where self-hosting is complete and the compiler builds and runs on both macOS and Linux.
Highlights
-
Self-hosting. The native compiler rebuilds itself byte-for-byte (
bin/build); the Zend seed is only the cold first boot. The self-host fixpoint (stage-2 IR == stage-3 IR) is green on macOS and Linux. -
macOS + Linux. Both platforms build the compiler and pass the full AOT suite (582/582). Output binaries are fully static and call libc and nothing else.
-
A broad standard library, byte-compatible with PHP wherever an oracle exists: the DateTime family + procedural date/time (
strtotime, timezones), networking with TLS (streams, sockets, DNS/inet), hashing/HMAC/crypto, base64/URL, CSV/INI, theprintf/sscanfformatting family, and PCRE via libpcre2. -
Install from source — no prebuilt binary, the compiler builds itself:
curl -fsSL https://raw.githubusercontent.com/manticorephp/compiler/main/install.sh | bash export PATH="$HOME/.manticore/bin:$PATH" manticore version # -> manticore 0.6.0
or
composer create-project manticorephp/compiler. Re-running upgrades in place, rebuilding the new version with the installed compiler itself.
Compile & run
manticore compile app.php -o app && ./app
echo '<?php echo "hi\n";' | manticore compile -o /tmp/hi && /tmp/hiBuild-host requirements
- clang / LLVM ≥ 15 (Manticore emits opaque-pointer IR)
- PHP 8.5 — cold bootstrap only; the output never calls a PHP runtime
- cc, libpcre2, OpenSSL 3, pkg-config
- Linux: glibc ≥ 2.33
See docs/install.md for per-OS setup.
Notes
Versioning starts at 0.6.0 to reflect the scope already shipped (self-host + the standard-library work above), not a from-scratch 0.1. The extension model is deliberately not Zend's: no C-extension API or php.ini — libraries and FFI via a build manifest.