Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a possibility of there ever being a PHP.NET?

Tags:

.net

php

clr

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?

like image 970
Adam Harte Avatar asked Dec 10 '09 20:12

Adam Harte


4 Answers

Someone has actually already begun working on just such a thing

http://www.codeplex.com/Phalanger

http://www.php-compiler.net/doku.php

like image 63
Darrell Brogdon Avatar answered Oct 20 '22 02:10

Darrell Brogdon


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#.

like image 22
Antony Carthy Avatar answered Oct 20 '22 04:10

Antony Carthy


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.

like image 3
monksy Avatar answered Oct 20 '22 02:10

monksy


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,...

like image 3
Miloslav Beňo Avatar answered Oct 20 '22 03:10

Miloslav Beňo