When it comes to PeachPie, it is a project tailored to supporting the PHP language natively on the .NET runtime, and is available in a 1.0.0 release with a lot of new features, including IDE support as its main goal is to get as many developers to use it as possible.
(source – peachpie.io)
The project was originally announced all the way back in 2016 with the intention of not only being a runtime for PHP on .NET, but a full development platform that allows legacy PHP codebase to be integrated incrementally with two-way interaction between the PHP and .NET worlds. A lot of PHP extensions are supported through PeachPie, so you can imagine what this means.
According to the developers: “PeachPie is a development platform that allows developers to treat the PHP language as a native .NET language. It consists of a whole compiler, runtime, extension libraries, IDE support, MSBuild support, all fully respecting the .NET standard.”
That being the case, the PeachPie 1.0.0 release will contain support for the 7.4 version of PHP which is one of the most common versions being used, and has integration with IDEs, has user-friendly error messages, and a number of other features that are intended to help any developer easily adopt it.
Furthermore, there is even an online version of the compiler that lets you try out compiling PHP code to C#, as well as Visual Basic, or the .NET IL to get an idea of what the generated code will end up looking like. Compiling to WebAssembly is also supported, and the PeachPie project makes few explicit claims about performance, with the benchmarks section of the site listing only a few. Of those listed, PeachPie scores better than both of the original PHP runtimes, as well as the HHVM project which is divided by Facebook in order to accelerate PHP performance.
? Just shipped PeachPie 1.0.0!
Read the full press release ?https://t.co/7lU0ETeFzx
— PeachPie Compiler (@pchpcompiler) March 15, 2021
Now, as for the goals of V1.0.0, the developers have focused on open-source PHP projects, as well as other client’s applications, and intended to get them running on .NET fluently. There were also a few features that were necessary to implement so that the project could be usable. PHP projects can now be opened, built and debugged, and even profiled in Visual Studio, and the latest WordPress version running on .NET without any source files is available, which includes the majority of plugins, including WooComemerce as well as Elementor and their themes. There are also selected composer packages that can be used as a class library through a C# project, using Twig, PHPUnit, RandomLib dependencies, and the Laravel Framework.
If you already have a .NET application and a PHP application, and you need them to work together or you just want to maintain one platform or solution, this is now a possibility with PeachPie. This is due to the fact that the PHP project is treated as another C# project. MSBuild, compilation, deployment, code analysis, and dependencies between your project can simply work.
Migration is also important. There’s this common scenario where a company’s legacy code is written in PHP, and it is maintained due to the fact that it has all of the magic functionalities that need to be upheld. As such, PeachPie makes it a .NET library, and all of the functions, as well as classes, can become standard .NET projects.