Sorry if this is a silly and/or stupid question but... Will there ever be, or would it even be possible to have a PHP.NET? Or have I got the wrong end of the stick?
It seemed to me that one of the main points of .NET was that you could write your code in one of a bunch of the .NET languages and have it compile into CLR. Could this happen with PHP, or is there something about PHP that makes this impossible? Or is there more political reasons?
Someone has actually already begun working on just such a thing
http://www.codeplex.com/Phalanger
http://www.php-compiler.net/doku.php
As an aside:
I don't believe .Net support for PHP would be a great idea.
I use PHP every day of my life. It's not because I like the language (it's a collection of mismatched functions with very little OO support), but rather because it's the best tool for the job.
PHP has a lightweight feel and one can do almost anything in a few easy lines. It's string handling is effortless, and support is ubiquitous. Array handling is great, too.
I feel that if PHP joined the .Net CLR I would not be tempted to switch over to use it. If one wanted to work with .Net one would do better to use a nicer, better structured language, such as C#.
I would say that it is unlikely as that there is ASP.net, but I would not say never because of Python.NET or IronPython. There is already one attempt called Phalanger. From the looks of the official wiki, its a serious development effort.
Actually it exists. It's not called PHP.NET, but Phalanger(http://phalanger.codeplex.com). It compiles PHP code into MSIL instructions.
It allows to run PHP application in so called legacy mode (and you can benefit from a faster running time since it's compiled), and if you want to use CLR features that are not present in PHP you can turn on PHP/CLR compiler extensions.
There is also so called Pure mode where PHP langauge is modified to behave more like C# or Visual Basic.
I think combining PHP and .NET is great idea, since you can make the best of both worlds. From PHP it would fast development and deployment process, steep learning curve and there are lots of great PHP open-source applications. On the .NET side, verifiable ISO standartized environment, peformance, managed secure code, advanced development tools,...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With