.NET Zone is brought to you in partnership with:

Jakub graduated Software Engineering at Faculty of Mathematics and Physics at Charles University in Prague, Czech Republic. He works on open-source .NET implementation of PHP - Phalanger. Currently he works as a software developer and founder in DEVSENSE s.r.o. Jakub is a DZone MVB and is not an employee of DZone and has posted 3 posts at DZone. You can read more from them at their website. View Full User Profile

Phalanger 3.0 updates for March 2012 - new features and better performance

02.27.2012
| 3209 views |
  • submit to reddit

On February 2012, Phalanger – the PHP compiler for .NET – got a lot of new features, fixes and optimizations. You can see the full list of changes (still growing) at phalanger.codeplex.com/SourceControl/list/changesets. The most noticeable change is the performance of accessing PHP arrays and overall performance compared to previous versions and standard PHP itself!

Performance

You can check full benchmarking results at Benchmarks page. Phalanger performs great even in comparison with latest release of PHP using op-code cache. Still, there is a lot of other possibilities of improving Phalanger (planned for future releases).

Compared to standard op-code cached implementation of PHP, running on Windows, Phalanger is able to serve significantly more pages per second. Since Phalanger compiles PHP code into .NET assemblies which are later compiled into native machine code using .NET Just-In-Time compiler, the generated code uses maximum from your actual server’s CPU.

Phalanger performs compile time analysis of the code. It allows to build smaller op-code that does exactly what it has to do without an undesirable overhead.

Note in addition to better performance; Phalanger gives you .NET interoperability, security, compile-time code verification and powerful development environment, where you can debug your PHP projects as you are used to from C#.

New features

Phalanger is being more and more compatible with actual PHP 5.4 “specification”. List of missing features is smaller every month. You can take a look at wiki.php-compiler.net/Compatibility to ensure, there is really a little things missing. Most of PHP applications work out of the box, needing a little or none modifications.

Some new features:

  • Improved implementation of PHP array which saves memory and CPU ticks.
  • “filter” extension partially implemented.
  • PHP compatible mail()ing.
  • Faster concatenation, arithmetic operations, unary operators, …
  • Working with .NET IDictionary and IList seamlessly as with PHP arrays.
  • Nice(r) debug view using Phalanger Tools for Visual Studio.
  • flock() available on Windows.

Also we are running new discussion forum at support.devsense.com (which is unmodified Phalanger-powered phpBB). Feel free to ask/list or answer any question you’d like to.

References
Published at DZone with permission of Jakub Misek, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)