What is Elephc?
mainElephc is a PHP-to-native compiler that compiles a subset of PHP directly to native assembly. It produces standalone binaries for macOS ARM64, Linux ARM64, and Linux x86_64 without requiring the Zend Engine, an external PHP runtime, or PHP-FPM.
Key characteristics:
- AOT Compilation: Ordinary source is Ahead-of-Time compiled with no opcode fallback.
- Standalone Binaries: The output is a single executable containing only the necessary runtime routines.
- Experimental
eval(): Can embed an optional interpreter bridge (Magician) when runtime parsing is required. - Native Extensions: Provides tools like
packed class,buffer<T>,ptr, andextern(FFI) for systems and performance-critical work.