PinchPi

PHP 8 interpreter written in pure Erlang/OTP for the BEAM virtual machine.

v0.1.0 Erlang MIT

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, and Throwable error 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 + yecc Parser: dedicated stateful binary lexer (HTML/PHP mode switching, heredocs, nowdocs, string interpolation) paired with a clean yecc grammar.
  • OTP 28+ Native Core: zero external runtime dependencies in the core, leveraging OTP 28+ primitives including the native json module.

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