swoole/typephp

Compile PHP to Native Binaries

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 13 minutes ago
Added to GitGenius on August 28th, 2026
Created on May 11th, 2026
Open Issues & Pull Requests: 11 (+0)
GitHub issues: Enabled
Number of forks: 49
Total Stargazers: 1,028 (+0)
Total Subscribers: 9 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 3.4 hours
Mean response time: 7.3 hours
90th percentile: 12.4 hours
Tracked items: 13

How this project is maintained

Around half of the issues opened in the past year never receive a reply. Only 18% of issues opened in the past year have been closed. Three people close 100% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 6
New in 7 days: 17
Closed in 7 days: 11
Avg open age: 0 days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 17
Closed in 7 days: 11
Comments in 7 days: 17
Events in 7 days: 26

Top labels

  • question (2)
  • invalid (1)

Detailed Description

TypePHP is a native AOT compiler that translates PHP source code into optimized machine code ahead of time, producing native executables, PHP extensions, and shared libraries while preserving PHP syntax.

TypePHP solves the performance limitations of interpreted PHP by compiling source code to native binaries rather than relying on bytecode interpretation or virtual machines. It translates PHP into C++ and then into native machine code, enabling the compiler to emit fast, statically-typed code for performance-critical paths. The tool maintains compatibility with PHP's dynamic features through PHPX interoperability with the Zend runtime, allowing dynamic values, internal functions, reflection, and object metadata to continue working alongside compiled user functions. A two-phase compilation design—prepare and convert—ensures deterministic builds across multi-file projects and self-hosted scenarios by deferring constant and declaration lowering until all project symbols are known.

Developers considering TypePHP should understand that it intentionally supports a defined subset of PHP rather than claiming drop-in compatibility with all existing PHP programs. The project maintains an explicit list of incompatible PHP features that users must review before adopting it for existing applications. TypePHP suits projects where native performance is a priority and where the codebase can be adapted to work within the supported feature set. The tool's self-hosting nature—where the compiler binary itself is built by compiling TypePHP's own PHP source code—demonstrates the viability of the approach but also indicates that users should expect the project to be under active development with evolving capabilities.

The project shows sustained engineering effort focused on correctness and determinism in the compilation pipeline. Development activity demonstrates attention to the multi-file build process and the self-hosting bootstrap chain, with deliberate design choices around symbol resolution and constant evaluation. The maintainers have invested in comprehensive documentation of incompatible features and compatibility constraints rather than obscuring limitations.