2

I read in some Microsoft documentation that PHP, together with Ruby on Rails, is now "part" of the .NET languages.

I would like to know whether its way of working (within .NET) is similar to C# and VB.NET. In the specific: 1) Is the PHP code compiled by the CLR into IL? 2) Is it possible to interchangeably use .NET code written in PHP as it already happens with C# and VB.NET (components written in C# can be used by VB.NET and the other way around)?

3) Is Visual Studio going to support somehow an IntelliSense function for PHP?

4) Is PHP syntax kept in .NET or there are some modifications?

I ask you this questions because PHP is a language that from many point of view (for instance the typing) is totally different than the other .NET languages. Last but not least I do not see any advantage in compiling PHP into IL, because many of its strenghts stand in its interpreted language nature.

Thanks

Francesco

3
  • 1
    Could you provide a link to the documentation? There is a Visual Studio plugin called VS.PHP: jcxsoftware.com/vs.php but that's not the same. I've to see the documentation before I believe this :-) Commented Apr 20, 2011 at 8:01
  • @Rhapsody: Thanks for your answer. I refer to this link: groovypost.com/howto/news/…. It is a training kit, I cannot find the specifications, that is why I asked all these questions here Commented Apr 20, 2011 at 8:10
  • The link you supplied doesn't mention anything about PHP being part of the .NET languages. At all. It's about developing PHP on Windows, which is perfectly possible using IIS and FastCGI etc. Commented Apr 20, 2011 at 8:34

3 Answers 3

3

Well, maybe I'm absolutely wrong, but officially .net-supported server scripting languages are Python and Ruby.

If you want to do that, you'd check Phalanger, an open source PHP compiler for .NET:

And yes, it compiles PHP into MSIL, meaning that'd work on top of .NET CLR. I know there's a compilation option or configuration that let's you code in PHP and use .NET libraries.

Sign up to request clarification or add additional context in comments.

2 Comments

thanks for your answer. I knew that .NET supports Ruby and Python but I was never interested because I am completely "blank" about these languages. PHP instead makes me really curious and greedy :-D I will have a look at Phalanger. Do you have experience with it? If that is the case what is your opinion about it in terms of pros and cons?
I've no actual experience with it, but I did some research and it can compile phpBB and other PHP scritps with no troubles, so I imagine that for most of the cases, Phalanger would be a great solution in order to leverage .NET with PHP. Cons would be that you won't have non-ported PHP libraries and you'll need to use .NET ones, loosing any chance of portability. But if you're interested in .NET and you know PHP, it'd be a good option.
2

PHP can be compiled using Phalanger. I don't know much myself so I can only give you this starting point.

Good luck,
Alin

Comments

2

I assume you're talking about the Iron (I Run on .NET) languages. Like IronRuby, IronPython

PHP is not an official language supported on the runtime, however there are OSS tools IronPHP and Phalanger that will do it for you.

These are dubiously supported and not really in common use as far as I know.

  1. Yes.
  2. Yes (at least you can with IronRuby/IronPython)
  3. No idea.
  4. PHP syntax.

2 Comments

thanks for your answer. I will have a look at IronPHP. Do you have experience with it? If that is the case what is your opinion about it in terms of pros and cons?
@Francesco No I don't unfortunately. I'm just going off what I've heard people say and read.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.