mrkeyoor.com_
Tue 01 Sept 17:39 UTC
Dev Toolsevaluationupdated 28 Aug 2026

typephp review

TypePHP is an ahead-of-time compiler that turns a supported subset of PHP into native executables, PHP extensions, shared libraries, or WASI components. It aims to give typed, computation-heavy PHP code native compilation without forcing developers to rewrite an entire project in C++.

+345 / 3dstars / 7d
Verdict

We could not produce an install, build, or test result because our sandbox had no supported PHP runner and the repo had no Dockerfile. TypePHP is unusually ambitious and technically specific, but version 0.6.6 still reads like an expert-led evaluation target rather than a safe default for production PHP. Try it on a small, typed compute kernel first, and keep ordinary PHP available until compatibility and deployment are proven in your environment.

We ran it

Answers from our run

Did you run typephp yourself?

No. Its code is PHP, and it carries no manifest our lab installs from, and no Dockerfile, so there was nothing standard to install, build or test. This review is written from the repository's own documentation.

Who should not use typephp?

Existing Laravel, WordPress, or highly dynamic applications expecting drop-in compatibility

What are the alternatives to typephp?

PeachPie, KPHP, FrankenPHP. TypePHP is unusually ambitious and technically specific, but version 0.

Setup2/5Native toolchain and matching PHP embed library required
Docs4/5Clear architecture, requirements, and compatibility warnings
Community3/5751 stars, five open issues, and very recent activity
Maturity2/5Active version 0.6.6 with an intentionally limited PHP subset

Who it’s for

PHP teams with numeric or container-heavy hot paths they can isolate and type
Extension authors who want PHP syntax with native output
Compiler enthusiasts willing to work within a deliberately limited PHP subset
Teams evaluating native binaries or WASI components from PHP source

Who it’s NOT for

Existing Laravel, WordPress, or highly dynamic applications expecting drop-in compatibility
Teams that need a proven, low-friction production compiler today
Developers on PHP versions older than 8.4
Anyone unwilling to maintain C++17, PHP embed, CMake, GMP, and MPFR dependencies

Setup reality

We did not run TypePHP: our sandbox had no supported PHP ecosystem runner, and the repository provided no Dockerfile, so install, build, and test counts are unavailable. That is a meaningful setup finding rather than a performance result. The README describes a substantial native toolchain, including PHP 8.4 or 8.5 development files, a matching embed library, C++17, CMake 3.24+, Composer 2, GMP, and MPFR, so this is not a one-command trial unless your machine is already prepared for PHP extension development.

TypePHP trades PHP's flexibility for native compilation

TypePHP sits in an unusual middle ground. It accepts familiar PHP, adds compile-time type information, lowers supported code to C++17, and produces machine code instead of Zend opcodes. The pitch is not merely a faster web runtime. It can create a native executable, a loadable PHP extension, a shared library, or a WASI component, which makes it closer to a language toolchain than a conventional PHP accelerator.

The project is explicit that it supports a defined subset rather than every dynamic PHP program. That honesty matters at version 0.6.6, because reflection, runtime behavior, frameworks, and dependency-heavy applications can expose assumptions that a compiler cannot preserve. TypePHP keeps Zend interoperability for supported internal functions and metadata through PHPX, but adopting it still means identifying which code can be compiled and which code must remain ordinary PHP.

Our run produced no build or test result

We did not run TypePHP in our sandbox. Our run had no supported PHP ecosystem runner, and the repository had no Dockerfile that could provide a documented, reproducible path around that limitation. We therefore have no honest install time, compile time, benchmark, or test count to report. This result says nothing about generated-code speed, and it would be misleading to turn the README's performance claims into our measurements.

It does tell prospective users something useful about evaluation friction. The stated baseline includes PHP 8.4 or 8.5 CLI and development headers, a matching PHP embed library for Unix binary or library builds, GCC 9+ or Clang with C++17, CMake 3.24+, Composer 2, GMP, and MPFR. A prepared extension-development workstation may already have much of that, but a clean container does not become a TypePHP lab with one copied command.

The strongest ideas are concrete, not cosmetic

Self-hosting is the clearest proof of ambition. The compiler is written in PHP, and its own tpc binary is built by compiling that PHP source with TypePHP. The documented two-phase design first gathers declarations and then lowers bodies and constants after project symbols are known. That is a credible architectural answer to deterministic multi-file builds, not a decorative feature added around a transpiler.

The native type system also targets workloads where representation costs matter. Integers, floats, and booleans map to C++ scalar types, while typed containers include std::array, std::vector, std::map, and std::ordered_map. High-precision work gets bigInt through GMP, bigFloat through MPFR, and decimal through libmpdec. The README claims speedups, including up to 10 times for containers, but we did not reproduce that figure on our box.

The output choices are genuinely useful. A team could compile a command-line worker as a binary, expose a carefully typed kernel through an extension, or package common logic as a shared library. Mixed PHP and C++ calls create an escape hatch for specialized routines. Modern syntax coverage includes PHP 8.4 property hooks and PHP 8.5 features, while generated getters, setters, constructors, and array conversion reduce some repetitive typed code.

Compatibility is the main product risk

The largest weakness is the same constraint that enables optimization: TypePHP cannot promise that an arbitrary PHP application behaves unchanged. Dynamic values, framework conventions, reflection-heavy libraries, late binding, and runtime code loading all deserve project-specific investigation. The README points readers to an incompatible-feature list, which is good documentation practice, but a list cannot replace compiling your dependency graph and exercising real traffic paths.

Deployment is also more native than the phrase "PHP compiler" may suggest. Binary and library modes still depend on PHPX, libphp, and configured native libraries being present in the package. Cross-platform badges cover Linux x64, Linux ARM64, macOS ARM64, and Windows x64, while WASI broadens the target set, but the README identifies Linux x64 as the primary full-test platform. Treat other targets as environments to verify, not equivalent promises.

Source protection is a practical benefit, yet it adds operational tradeoffs. Native artifacts can be harder to inspect, debug, patch, and reproduce than deployed PHP source. Compiler diagnostics, symbol handling, packaging, security updates, and ABI matching become part of the ownership burden. Teams should decide whether a narrow extension or worker justifies that cost before considering a whole application.

Activity is encouraging, maturity is still limited

Project health looks active rather than abandoned. The latest release, v0.6.6, arrived on August 27, 2026, and the repository was pushed again on August 28. Five open issues is a small visible queue, though that number alone does not reveal response quality or how many users exercise difficult edge cases. The 751 GitHub stars show real curiosity, not broad production proof.

The release number and compatibility warning should carry more weight than the fresh commit alone. Rapid work can improve support quickly, but it can also mean interfaces, diagnostics, and generated output are moving. GPL-3.0 licensing also deserves review before distributing compiled products or integrating TypePHP into proprietary delivery pipelines. Get legal advice for your actual distribution model rather than treating compilation as a licensing shortcut.

It belongs beside PHP before it replaces PHP

The sensible real-stack position is 1 bounded component. Keep the web application, routing, templating, and dynamic integrations on the standard PHP runtime, then test TypePHP on a typed numeric service, batch worker, parser, or extension where inputs and outputs are controlled. Compare correctness first, deployment reproducibility second, and performance only after both pass.

For a team on PHP 8.4 or 8.5, a pilot should pin the compiler version, capture the complete native toolchain, build in CI, and exercise failure paths as well as hot loops. TypePHP is worth watching and worth a focused experiment for the right workload. It is not yet the boring default, and boring is exactly what most production PHP applications need from their runtime.

Alternatives

ProjectWhat it isPick it when
PeachPieA PHP compiler and runtime for .NET.pick this instead when your target platform and application stack are already centered on .NET.
KPHPA PHP-to-C++ compiler designed for statically analyzable PHP applications.pick this instead when you want an established PHP-to-C++ approach and can accept its own compatibility constraints.
FrankenPHPA modern PHP application server built on Caddy.pick this instead when your real goal is simpler deployment and persistent workers, not compiling PHP into native code.

What people are saying

  1. [github-trending] swoole/typephp

Sources

  1. TypePHP GitHub repository
  2. TypePHP homepage

More dev tools reviews

workmux · v2rayNG · SecLists · hashcat · eslint · fastfetch · the whole board →