
Compile PHP to .NET online - pchp
http://try.peachpie.io
======
Avalaxy
The generated C# code is so weird and completely incomprehensible. I've never
seen anything like that.

The practical use case also seems non-existent. How can you possibly translate
all sorts of functions that .NET doesn't even have?

~~~
sebazzz
To be fair, it is decompiled code you are looking at. If you open the dropdown
you will find the optgroup with the label that says "Decompiled".

------
sky_rw
Serious question: Who is this for?

~~~
pchp
Depends if you mean this tool or the compiler in general. I'd recommend
distancing yourself from your possible prejudices against either language,
taking a step back and looking at it objectively. You won't be able to argue
against the fact that a massive chunk of the internet is written in PHP. You'd
also be hard pressed to disagree that .NET is an architecturally superior and
highly robust language with a very good tooling and service ecosystem. You can
make the connection.

~~~
sky_rw
I'm not being prejudiced. I have a genuine professional curiosity regarding
the use cases for this. Somebody clearly spent a lot of time and effort making
this, generally people don't do that sort of thing without a good reason. The
fact that I cannot fathom a reason for this makes me think there is room for
self education. It's good to take that approach is all aspects of life I
think.

~~~
pchp
Not disagreeing with you. Somebody posted the usecases below
(https:/www.peachpie.io/usecases). The most common usecase is basically a
legacy site in PHP that wants to/has to migrate to .NET. Reasons can include
connecting PHP to .NET modules, performance enhancements, security issues that
.NET doesn't have to worry about. There are other possible usecases though,
like producing/consuming NuGets from PHP codes, distributing PHP apps
sourcelessly, being able to run PHP apps on any platform or OS, extending
massive PHP frameworks with C# modules, for instance. And then some funky
exotic ones like crating games/apps/IoT software in PHP.

For most people (not saying it's your case) it's just a matter of not being
that close minded and understanding that different companies or devs might
have different language preferences. Or just to look outside their current box
of thinking and see that any of the above might be useful for someone.

