VKCOM / kphp
- суббота, 14 ноября 2020 г. в 00:24:27
C++
KPHP — a PHP compiler
KPHP is a PHP compiler. It compiles a limited subset of PHP to a native binary running faster than PHP.
KPHP was developed at VK.com and maintained as proprietary for years — until open-sourced in late 2020.
Visit the KPHP website with documentation, demos, etc.
KPHP wouldn't compile just any random PHP code:
Read more on this here: KPHP vs PHP differences.
KPHP analyzes your code as a whole and performs various optimizations focusing on performance and safety:
Aside from the above, KPHP has coroutines. For now, however, they are almost inapplicable outside of VK code.
Generally, when your code fits best practices, it runs 3–10 times faster than PHP.
Take a look at the benchmarks page comparing KPHP and PHP performance.
You can also refer to PHP vs KPHP vs C++.
KPHP isn't always faster than PHP, but it can be used to speed up your code by focusing on strict typing and KPHP built-in functions.
This situation is quite common. KPHP rarely compiles already existing code without errors. It usually takes some time to rewrite PHP code for it to be compilable with KPHP.
Read more about this in compiling an existing project.
KPHP is distributed under the GPLv3 license, on behalf of VK.com (V Kontakte LLC).
To communicate with KPHP community, use Github issues or public E-Mails available on Github.
You can also take a look at our FAQ page.
Please, refer to the Contributing page.
Proceed to the installation page and just follow the left menu.