Write naturally
Start with variables, arrays, functions and classes. Add explicit types where they communicate intent.
HolyPHP brings the directness of PHP-style syntax to a compiled language. Check your code, build a native program, and use one toolchain from your first script to a larger application.
// Write a small program
function greet(string $name): string {
return "Hello, {$name}!";
}
echo greet("Ada");
hphp run hello.hphpRun from your terminalKeep the fast feedback loop of a scripting language, with a compiler that can produce a standalone native executable.
Start with variables, arrays, functions and classes. Add explicit types where they communicate intent.
Use hphp check to surface type and borrow errors without having to run the program.
Run a source file during development or build it into a native executable for distribution.
HolyPHP is not PHP running through FPM. Its compiler and runtime power programs written in the language itself.
Familiar variables, control flow, strings, arrays, classes, closures and typed function signatures.
&Compile-time rules help control aliases and mutation. Unsafe pointer operations are marked explicitly.
{ }Explore desktop UI, async I/O, threads, WebSockets, HTML layout and the HolyIDE workbench.
>_Check, run, emit compiler output, build executables and manage packages from hphp.
Use the HolyPHP VS Code extension for syntax highlighting, completions and diagnostics.
□Try the package commands and learn from complete programs shipped in the repository.
HolyPHP offers inferred types for quick scripts and explicit signatures when you need them. Its borrow checker diagnoses supported conflicting uses before code generation.
How memory safety works →// Types can be inferred
$count = 3;
// Or stated in a signature
function total(int $a, int $b): int {
return $a + $b;
}
echo total($count, 4);
Installers build the compiler for your platform. A C compiler is used when hphp run or hphp build compiles a program.
Follow a guided path, experiment in your browser, or see how the project is built.