Language
20/21
language features fully supported
Classes, enums, traits, closures, generators, fibers, match, references, namespaces. Partial: eval().
Pronounced el-ef-see — just spell out “LFC”.
elephc is a from-scratch compiler for a static subset of PHP:
parse, type-check, lower to native assembly, assemble, and link.
Standalone executables, shared and static libraries, iOS library targets, and three --web isolation modes today.
No VM. No Zend Engine. No opcode fallback.
PHP compatibility
Counted symbol by symbol against PHP 8.5.10 (68 extensions, 2,169 functions) and generated from the compiler's own builtin registry, not maintained by hand.
Language
20/21
language features fully supported
Classes, enums, traits, closures, generators, fibers, match, references, namespaces. Partial: eval().
Default PHP build
71%
of PHP functions (644 / 901)
What a plain php-src ./configure compiles in: core, standard, date, pcre, spl, json, session, dom, and 20 more.
All 68 bundled extensions
45%
of PHP functions (983 / 2,169)
Everything in the reference PHP build, including opt-in extensions such as intl, gmp, sodium, and pgsql.
4 complete · 6 partial · 3 missing
mbstring 100% pdo 100% session 100% xml 100% curl 98% hash 48% pcre 45% ctype 36% dom 15% openssl 6% fileinfo 0% filter 0% tokenizer 0% 2 complete · 2 partial · 2 missing
iconv 100% session 100% pcre 45% ctype 36% simplexml 0% tokenizer 0% 1 complete · 3 partial · 0 missing
json 100% mysqli 79% hash 48% pcre 45% Percentages count each extension's functions and classes; an extension is complete only when its constants are all there too. Covering an extension is necessary, not sufficient: elephc compiles a static subset of PHP, so today frameworks keep running on PHP while their static modules compile to native libraries.
DOOM, played from the original WAD
Written in PHP, compiled to a native binary with elephc
Positioning
elephc stays close to the PHP ecosystem while drawing a clear technical line: supported code is compiled ahead of time to native assembly. Standalone executables, shared libraries, and static libraries are available today, with a PHP extension bridge on the roadmap.
Compiler model
elephc is not a PHP packager and does not bundle Zend/PHP. It parses PHP, type-checks a supported static subset, lowers it to native assembly, then assembles and links it with a small runtime included in the output.
Runtime contract
There is no interpreter, VM, Zend Engine, or opcode fallback waiting behind the compiled path. Unsupported dynamic behavior is a compiler boundary, not a silent fallback mode.
Framework direction
The strategy is hybrid: WordPress, Laravel, Symfony, and other PHP applications can keep running on PHP while static modules move into native libraries today and PHP extensions in the future.
elephc is a from-scratch compiler for a static subset of PHP. It is not a packager for the PHP runtime, and it does not ship Zend/PHP inside the result. The pipeline is parse, type-check, lower to native assembly, assemble, link, and include a small runtime in the binary. If elephc compiles it, it runs as native code.
Not a drop-in replacement for an entire dynamic framework today, but a path to accelerate static modules inside existing PHP applications. Keep the framework on PHP, isolate static and performance-sensitive modules, and compile them into standalone executables or native libraries. A PHP extension bridge remains future work.
Get started
elephc builds executables for macOS ARM64, Linux ARM64, and Linux x86_64, and cross-compiles libraries for iOS ARM64 devices and the iOS ARM64 Simulator. The elvm version manager installs releases side by side and selects a global or project-specific compiler.
curl, tar, and shasum or sha256sum as, ld, libc dev files) cargo) cc, ar, ranlib Manual release downloads and complete setup details are in the installation guide.
0.1.0 Basic CLI compiler 0.27.4 Native testing with isolation and JUnit reports; explicit C integer widths (breaking) and f32 FFI; floating-point pointer helpers; strip_tags(), BcMath\Number, WeakMap, Core symbols, and an HTML-only DOM subset; JSON enum support; tail-recursion, eval, memory, and array optimizations; runtime compatibility fixes, macOS notarization, and TLS security updates 0.27.5 Security fixes for --web sessions and request state; natural C layout for extern class fields (breaking for bool); integer loop counters and buffer loop optimizations; pointer formatting and nested packed record fixes 0.27.6 The real DOOM showcase; C-width packed fields and buffer elements; arrays of pointers and buffers; static buffer and pointer properties; buffer_ptr() and nullable extern strings; relative namespace\ names; PHP string ordering; final-class dispatch and small-method inlining; filenames in diagnostics; memory-safety and runtime compatibility fixes current next PHP extension bridge for framework integration next Multi-file library builds and pkg-config metadata 1.0.0 Production-ready