PeachPie Compiler: Compile and run PHP on top of .NET runtime
peachpie.io
peachpie.io
It's much faster to learn C# in the long term than to run PHP on top of .Net.
https://learn.microsoft.com/en-us/dotnet/csharp/language-ref...
And, it's getting better over time:
https://github.com/dotnet/csharplang/issues/4935
This is essentially how I respond to web requests in my codebases right now:
var table = $@"<table>
<tr><th>Name</th></tr>
{string.Join('\n', items.Select(i => $"<tr><td>{i.Name}</td></tr>"))}
</table>";https://slack.engineering/taking-php-seriously/
I would consider poor man's PHP as something to reimplement that architecture, rather than any particular language feature.
<script>Alert("hi")</script>Benefits of this are dubious at best. The php interpreter is already a low level C project so why replace that with .net? Makes no sense.
You are comparing apples with pies here. PHP is a interpreted language, while .NET is a compiled target.
However, this peachpie project seems to be far from stated goal and more of a research project currently.
The activity graph on GitHub says it is mostly dead. There is some activity, but at best it is in maintenance mode. It used to be sponsored, but not anymore IIRC
https://github.com/peachpiecompiler/peachpie/graphs/contribu...
> Project goals: Both-way interoperability, Full .NET compatibility, Security, Cross-platform development, Increased performance - https://github.com/peachpiecompiler/peachpie
So seems they're aiming to use the PHP language but on a different runtime, for the listed reasons. Sounds kind of out there, but seems at least the .Net Foundation supports it, I'm guessing for the same reasons.
Maybe this tooling will help add PHP to that list.
That way you are not maintaining 6 codebases.