PeachPie PHP to .NET project reaches 1.0 milestone
- 18 March, 2021 16:20
Originally announced in 2016, PeachPie is intended to be not only a runtime for PHP on .NET, but a full development platform. It allows a legacy PHP codebase to be migrated incrementally, with two-way interaction between the PHP and .NET worlds. Many, but not all, PHP extensions are supported through PeachPie.
The PeachPie 1.0 release contains support for the commonly used 7.4 version of PHP, integration with IDEs, user-friendly error messages, and a number of other features intended to help developers adopt it.
An online version of the compiler lets you try out compiling PHP code to C#, Visual Basic, or the .NET IL to get an idea of what the generated code is like. Compiling to WebAssembly is also supported.
Right now the PeachPie project makes few explicit claims about performance, with the Benchmarks section of the site listing only a few. But of those listed, PeachPie scores better than both the original PHP runtimes and the HHVM project devised by Facebook to accelerate PHP performance.
The announcement blog post provides some detail about using PeachPie’s ahead-of-time compilation tool, NativeAOT, for further performance enhancement, noting the gains will vary depending on workload and the state of the original PHP code. PHP code with type hints tends to perform better, as it allows PeachPie to perform more targeted optimisations.
Many existing PHP applications are available in PeachPie’s catalog of applications ported to the PeachPie runtime. Among them is WordPress, arguably the most popular application written in PHP, and one of the apps most likely to benefit from the performance boosts promised by PeachPie.