Skip to content

[GitHub Trending] swoole/typephp

6 relevance
Score Breakdown
technical depth
8
novelty
7
actionability
4
community
5
strategic
4
personal
5

Scored daily by a customisable AI persona to surface the most relevant engineering leadership news.

PHP to native compiler, technically interesting but niche.

Open Source github.com
Compile PHP to Native Binaries. Contribute to swoole/typephp development by creating an account on GitHub.
Summary

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.

Author

swoole