The project is getting closer to the first stable release. Let’s take a look at the progress we’ve made, what was implemented and what are the next steps in getting the PHP world closer to the modern .NET platform.
The project covers the entire PHP language and libraries. Everything is implemented from scratch on top of .NET, using managed safe C#, with a slightly different approach – the code is compiled like any other .NET language. A majority of the features relies on the BCL, whose status you can see at docs.peachpie.io/compatibility-status. The more difficult task is to make the .NET compiler and runtime behave like the PHP engine. The set of currently supported features can be seen at docs.peachpie.io/php/compatibility.
As you can see, there are still a few extensions and standard functions that are not available on the PeachPie platform:
The compiler and runtime are mostly complete; all the major features are supported: the entire type system, value handling, language dynamicity, reflection, exceptions, generators, etc. – there is a lot of stuff in PHP. Check the link above for the high-level list of such features. Nonetheless, there are some things we don’t plan implementing in this release so that they would behave exactly as they do in PHP: circular dependencies in traits (will be compiled properly in the next major release) and PHP-like garbage collection! PHP counts references, calls destructors deterministically and synchronously. The .NET runtime, however, does not. This might cause a few compatibility issues. At least PeachPie reports a warning during the compilation phase.
The latest non-preview version 0.9.800 implements more of the PHP features and fixes some edge cases in the compiler:
- lots of date-time related functions
- less code is emitted resulting in less overload resolution in run-time
- updated issues with using generic classes and methods in PHP
- more diagnostics and human-readable warnings
- compiler treats default values of parameters properly
- improved performance and memory usage
- C# indexers can be accessed from within PHP
- more password hashing and standard functions
- more reflection features
We’re already preparing the 1.0 release – something that won’t change for a while and covering most of the PHP 5.4 – 7.4 language. Our next goal is to finalize the documentation, cover all your questions and common use cases, prepare more samples and materials and concentrate on the tooling around PeachPie. We would like to make the experience as smooth as possible, to allow for a natural transition from PHP to .NET and a smooth integration of these two worlds.
In the future, you can expect an improved performance of the whole platform, more interoperability features including a full support of C#’s
dynamic and the whole spectrum of legacy PHP frameworks and components available to .NET.