Why PHP 8.5? A Deep Dive into Scripting Language Choice
Choosing a scripting language for a game engine is deeply personal, and we knew some people would raise eyebrows at our choice of PHP 8.5. Here's why it's the right call for Lenga.
Choosing a scripting language for a game engine is deeply personal, and we knew some people would raise eyebrows at our choice of PHP 8.5. Here's why it's the right call for Lenga.
Modern PHP is a much stronger fit for gameplay scripting than people often assume, and our PHP 8.5 baseline gives Lenga a dependable, modern language surface to build on. Typed properties, enums, generators, better static analysis, and a much more disciplined type system let us expose engine APIs that are clearer to read, easier to autocomplete, and harder to misuse by accident. PHP 8.5 is not interesting because of one flashy feature. It is interesting because the language is mature enough to support a serious scripting workflow cleanly.
The workflow argument matters just as much as the language features. In Lenga, PHP scripts extend Behaviour and interact with native engine systems such as Transform, Rigidbody2D, SpriteRenderer, SpriteAnimation, UI canvases, and physics queries. Public properties show up in the Inspector. Coroutines use generator-based yield instructions like WaitForSeconds. Signals provide a lightweight event model for gameplay code. That gives us a scripting layer that feels expressive without asking gameplay code to own rendering or physics internals.
The ecosystem argument is underrated too. PHP has decades of battle-tested tooling behind it: Composer, linters, static analysis, debuggers, profilers, and editors with excellent autocomplete support. If you already know PHP from web or backend work, that knowledge carries over surprisingly well. The engine runtime is still native C++, so the performance-critical work stays where it belongs. PHP is there to make gameplay iteration fast and approachable.
That said, PHP is not the right answer for every engine or every team. If your goal is to write every system at the lowest possible level, this will not be your preferred stack. But if you value fast iteration, readable gameplay code, and an ecosystem with strong tooling, PHP 8.5 is a serious and surprisingly practical choice.