[GitHub Trending] swoole/typephp
Scored daily by a customisable AI persona to surface the most relevant engineering leadership news.
PHP to native compiler, technically interesting but niche.
TypePHP is a self-hosting AOT compiler written entirely in PHP that translates PHP source code into C++17 and then native machine code, producing executables, PHP extensions, or shared libraries without a runtime interpreter or JIT. It maps int, float, and bool to C++ scalars for order-of-magnitude speedups on numeric code, supports strongly-typed containers up to 10× faster than PHP arrays, and includes compile-time safety annotations like #[Immutable] and #[ArrayDef]. The compiler supports PHP 8.4 property hooks, asymmetric visibility, and WASM targets, but intentionally supports a defined subset of PHP rather than full drop-in compatibility.
swoole