Not Your Daddy’s PHP
Back when .Net 2.0 was released, a few of the PHP developers we have on staff got a case of “framework envy.” For those of you who are not familiar with .Net 2.0, implementing it into your site is sort of like going from the brick mobile phones of the 1990’s to the 3GS smart phones dominating the market today. I’m sure you’ve all heard of Apple’s iPhone slogan, “There’s an app for that?” Well, .Net can take some creative license with that marketing gem; There’s a class for that.
So, what’s a poor PHP developer to do to eradicate framework envy? Well, the guys at Phalanger have a solution – they brought the .Net framework to PHP!
As we heard in the interview with Shaun Hirschman from Microsoft, the software giant is taking great strides to facilitate how things like PHP and MySQL run on the Windows Server OS (more information on the PHP on Windows campaign can be found on the Microsoft website). However, as we all know, larger corporations don’t always move at a speed that is fast enough for us. So, for those of you who have a Windows server, and want a more immediate fix, take a look at Phalanger. The Phalanger development team has worked very hard on getting PHP to run at the same speed as .NET, as well as incorporating much of the flexibility and control inherent in the .NET platform. For example, PHP .Net utilizes the .Net CLR to compile and run PHP, which means performance increases upwards of 50% over interpreted PHP, as well as native IIS support for PHP.
Another amazing feature of Phalanger is the ability to directly port PHP applications over from standard PHP to PHP .Net – potentially with very little, if any, code modifications. That includes porting popular existing PHP applications like PHPBB and PHPMyAdmin. It can even handle much of the components and extensions natively distributed with PHP.
So, someone will inevitably ask the question “why not just learn .NET?” And it’s a good question. The simple answer is time, or the lack thereof. It can take weeks, and even months, to learn a new language, much less a new development framework. Phalanaer bridges that gap in knowledge and allows PHP programmers to basically use the language they’re most familiar with but still take advantage of the benefits of a brand new framework. A good example of this is moving from a web application to a desktop application. With C# (a popular .NET language) you can easily go from the web to the desktop. With PHP? Not so much. To ease that pain, the amazing guys at Phalanger developed an extension for Visual Studio 2008 Professional or higher (NOTE: Express editions DO NOT support extensions) that gives Visual Studio complete support, including beta support for Intellisense and Windows forms and console support, for PHP .Net.
So, it sounds too good to be true, huh? Well, not entirely, but there are some things to consider before completely buying into Phalanger and PHP.net:
- While it is stable, and there are an increasing amount of user tutorials and great resources, there isn’t any major corporation, such as Zend or Microsoft backing it. This can be dangerous simply because no one is financially invested in keeping the project going.
- As we are now in the heady days of .Net 4.0, Phalanger has just finished porting the .Net 2.0 framework. Remember, this is an open source project from students at Charles University, Prague. As such, there is some lag between when Microsoft releases an update and when Phalanger can adopt the same improvements (Railo has a similar issue with ColdFusion).
Okay, two potential issues in an otherwise very ambitious project – one that is to the great benefit of developers around the world. Is Phalanger and PHP.Net ready for “Prime Time?” The answer is open to debate…so let’s debate! Are you familiar with Phalanger? If so, what are your thoughts? We’d love to hear them.
[NOTE: a huge thanks goes out to Kevin Sugihara, who started this post. While I get the byline, Kevin deserves the credit for the idea of the post and the great information it contains. Thanks, Sugi! – Derek]