PinchPi is a PHP 8 interpreter written in pure Erlang/OTP for the BEAM virtual machine. It is the clean-slate successor to ephp, redesigned from the ground up for Erlang/OTP 28+ and seamless Elixir interoperability.
-
PHP 8 Target: built for modern PHP 8 syntax and semantics (typed properties, union/intersection types,
match, nullsafe?->, named arguments, arrow functions, attributes#[...], enums, andThrowableerror hierarchy). -
Elixir-Friendly Structs: internal AST nodes and runtime values use Erlang maps with
'__struct__'keys instead of legacy#record{}tuples, making them first-class structs from Elixir. -
Stateful Lexer +
yeccParser: dedicated stateful binary lexer (HTML/PHP mode switching, heredocs, nowdocs, string interpolation) paired with a cleanyeccgrammar. -
OTP 28+ Native Core: zero external runtime dependencies in the core, leveraging OTP 28+ primitives including the native
jsonmodule.
Installation
Add pinchpi to your rebar.config dependencies:
{deps, [
{pinchpi, "0.1.0"}
]}.
Or in mix.exs:
def deps do
[
{:pinchpi, "~> 0.1.0"}
]
end