swoole

    swoole/typephp

    Compile PHP to Native Binaries

    backend
    PHP
    GPL-3.0
    1.5K stars
    78 forks
    1.5K GitHub watchers
    Updated Oct 26, 2026
    View on GitHub

    Build with Backblaze B2

    SDKs, agent skills, IDE extensions, and reference pipelines from Backblaze Labs. All open source.

    Explore Backblaze Labs

    Loading star history...

    Where it stands

    Rank, growth pace and release cadence relative to everything GStars tracks.

    5 releases in the last 90 days, the latest 13 days ago, with 18 contributors on GitHub.

    Use Cases & Benefits

    • Compile PHP source code into optimized native machine code executables, extensions, or shared libraries using ahead-of-time compilation.
    • Delivers near-native performance by translating PHP to statically-typed C++ and native binaries while preserving PHP syntax and interoperability with Zend runtime.
    • Use for building high-performance CLI tools or long-running services that benefit from native execution speed and reduced startup overhead.
    • Use for creating PHP extensions that integrate compiled functions and classes directly into the PHP runtime for enhanced performance.
    • Use for developing reusable shared libraries from PHP codebases to be consumed by other projects or languages with native bindings.

    Should you depend on it?

    License terms, project hygiene and risks, from GitHub metadata and GStars' snapshots.

    License

    GPL 3.0

    Copyleft: distributing software that includes it generally requires releasing your source under the same license.

    Community files

    • README: present

    Watch-outs

    • GPL-style copyleft: including it in distributed software generally requires releasing your source under the same license.

    General guidance from repository metadata, not legal advice. How we score

    From the README

    A native AOT compiler for PHP

    Compile PHP source code into native machine code ahead of time — producing native executables, PHP extensions, and shared libraries — while keeping the PHP syntax you already know.

    TypePHP is an Ahead-Of-Time (AOT) compiler that translates PHP source code into C++ and then into native machine code. Unlike a bytecode cache or a VM, it does not interpret opcodes at runtime: it generates optimized native binaries that run directly on the CPU.

    It keeps familiar PHP syntax and adds compile-time type information, so the compiler can emit fast, statically-typed C++ for hot paths. Dynamic PHP values, internal functions, reflection, and object metadata continue to interoperate with the Zend runtime through PHPX; user functions are not executed as Zend opcodes after they have been compiled.

    TypePHP is written entirely in PHP and is fully self-hosting: the tpc compiler binary is built by compiling the compiler's own PHP source code with TypePHP. The bootstrap chain is pure PHP — no C or C++ glue in the compiler itself.

    TypePHP is under active development. It intentionally supports a defined, testable subset of PHP rather than claiming drop-in compatibility with every dynamic PHP program. Read Compatibility model and the incompatible-feature list before adopting it for an existing application.

    Excerpt from the swoole/typephp README on GitHub (GPL-3.0 license). © its authors.Read the full README on GitHub

    Daily snapshots

    Stars gained per day, and how forks and open issues moved, from GStars' daily snapshots

    Aug 29: +136

    +665 stars over 60 days across 6 snapshot days; best day +136 on Aug 29.

    Forks

    78+40

    Open issues

    4-1

    Compared with peers in Backend

    Fastest-growing repositories GStars tracks in this cohort for the week of Nov 1, by 7-day star growth

    swoole/typephp compared with Backend repositories by stars, 7-day star growth, health score and last release
    RepositoryStars+7dHealthLast release
    anthropics/skills187.8K+2.9K15—
    DuarteSantos8/openGym19.7K+2.4K602 days ago
    shiyu-coder/Kronos47.0K+2.3K16—
    NationalSecurityAgency/ghidra98.2K+2.3K6414 days ago
    microsoft/VibeVoice56.0K+1.1K29—
    swoole/typephp1.5K—4913 days ago
    Category median56.0K+2.3K29—

    Discover Repositories

    Search across tracked repositories by name or description