title: Best way to call .NET classes from PHP?
body: <p>What are the best options for connecting PHP apps to logic located in .NET libraries?</p>
  
  <p>PHP, since v5.0, supports <a href="http://us2.php.net/manual/en/class.dotnet.php" rel="noreferrer">a DOTNET class</a> that is supposed to let me invoke .NET logic from a PHP script. But it seems there are many problems - I've not been able to get it to work reliably, with arbitrary .NET classes.  The doc is sort of slim and what <em>is</em> documented isn't really correct.  The questions on the internets on this class are many, as are the bug reports on php.net.  </p>
  
  <p>I have been able to get PHP to connect with .NET via COM interop - but this requires that the .NET class be ComVisible.  And as far as I know, because of the COM requirement,  this works on Windows only. </p>
  
  <p>I've heard of the <a href="http://phalanger.codeplex.com/" rel="noreferrer">Phalanger project</a> but don't know many details.  Does it work with arbitrary PHP scripts?  Work on Linux?  Does it have heavy perf or runtime implications? </p>
  
  <p>Does it even make sense to do this, or is it one of those you-could-do-it-but-you-shouldn't sort of things?</p>
  
  <p>EDIT: I'd like to hear about the general case: there is a wide variety of .NET class libraries available, and it would be nice to be able to take advantage of them from different environments, including PHP.  Examples might be encryption, logging, data access, clients to HPC clusters. The particular immediate scenario is a ZIP library with AES encryption, available in .NET. </p>