# VKCOM/kphp

KPHP — a PHP compiler

Repository: https://github.com/VKCOM/kphp
Canonical: https://ross.abutalabs.com/products/kphp
Homepage: https://vkcom.github.io/kphp/
Language: C++
License: GPL-3.0
License Family: copyleft
Topics: kphp, compiler, php
Last push: 2026-08-26T15:53:01+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 35, longevity 100
- inputs: {"age_days": 2123, "days_push": 7, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1523, forks 116 (observed 2026-08-28T04:04:58.112554+00:00)

## What it is
KPHP is a PHP compiler developed at VK.com that compiles a limited subset of PHP to C++ and then to a native binary running faster than plain PHP. It performs static type inference and compile-time optimizations, and runs the compiled code within an embedded HTTP server.

## Use cases
- compile PHP code to a fast native binary
- speed up PHP backend code by 3-10x
- add static type checking to a PHP codebase
- run PHP-like code without a PHP runtime or JIT
- build high-performance web services with PHP syntax

## When to choose
- you have performance-critical PHP code and are willing to adapt it to a strict type system
- you want compile-time type safety and optimizations for PHP-style code
- you are building a new backend service and prefer PHP syntax with native speed

## When to avoid
- you need to compile arbitrary existing PHP code without modifications
- you rely on unsupported PHP features like generators, anonymous classes, SPL, or XML parsing
- you need dynamic PHP features such as calling by name or mocks

## Facets
- artifact type: cli-tool
- maturity: active
- function: compiler, http-server, web-framework
- domain: compilers, programming-languages, web-development, backend, performance
- platform: cpp, cli
- tags: php, transpiler, static-typing, type-inference, native-binary, vk, compiler, linux, macos

## Member repositories
- VKCOM/kphp (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:58.112554+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T08:32:46.062327+00:00, confidence not recorded.
  - readme: https://github.com/VKCOM/kphp (fetched 2026-08-28T04:04:58.112554+00:00, sha b6f413e03a98)
  - homepage: https://vkcom.github.io/kphp/ (fetched 2026-08-29T11:34:28.953784+00:00, sha 84a273c295c2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
