http://www.developer.com/

Back to article

10 Experimental PHP Projects Pushing the Envelope


July 30, 2010

As the saying goes, "Just because you can do something doesn't mean you should." But in the world of programming, stretching boundaries is just part of the fun. The PHP community has never been one to shy away from bending their favorite language more ways than a shopping mall pretzel, and as the ten wild projects introduced in this article indicate, the fervor for experimentation is as strong as ever!

1. LisPHP

Lisp is the granddaddy of countless modern programming languages, having influenced the development of Haskell, JavaScript, Lua, Perl and Python, among others. Learning Lisp -- called "the greatest single programming language ever designed" (see Paul Graham's Lisp quotes page for others) by programming luminary Alan Kay -- is considered a rite of passage by many developers because of the profound impact it can have on the way one looks at programming problems.

Because of the language's decades-long popularity, quite a few Lisp dialects have sprung up over the years. For instance, you might have heard of Common Lisp and Scheme. MinHee Hong has made his contribution to this long list, creating LisPHP, a Lisp implementation written in PHP. Although only a few months old at the time of this writing, LisPHP already supports an impressive set of features, including an interactive command-line programming environment.

2. Phalanger

I'd imagine most readers are at least vaguely familiar with the.NET Framework, a software environment that supports conceivably any programming language. Among the languages currently able to run within the .NET environment are IronPython and IronRuby.

Thanks to Phalanger, you can add PHP to this growing list. This active project opens up a whole new array of wild possibilities for PHP developers, including the ability to create PHP-driven Silverlight applications, use PHP as a language for building ASP.NET applications much in the same way you would use C#, and even create console and traditional client-based GUI applications. Further, the Phalanger developers have been able to impressively keep stride with the core PHP development team, having already implemented many of the features found in PHP releases as recent as 5.3.1.

For some proof that Phalanger is not just an academic pursuit, check out the list of high-profile PHP projects capable of being run atop Phalanger.

3. PHPLinq

Some years ago I had the pleasure of attending a special Microsoft event in which .NET creator Anders Hejlsberg introduced another impressive technology known as LINQ (Language Integrated Query). LINQ helps to reduce what is often referred to as the "impedance mismatch" between various data-management paradigms such as relational databases and XML and object-oriented code by providing a data-query syntax that is natively recognized by the programming language.

Last year Maarten Balliauw brought a LINQ implementation to PHP with the release of PHPLinq, a class library that allows you to query data structures such as arrays, XML, and databases using PHP's familiar method-chaining syntax. For instance, check out this example (taken from Balliauw's blog post on the topic):

// Create data source$names = array("John", "Peter", "Joe", "Patrick", "Donald", "Eric");$result = from('$name')->in($names)            ->where('$name => strlen($name) < 5')            ->select('$name');

Similar syntax could be used to query other data sources, meaning PHPLinq can eliminate much of the need to adjust your approach to data access and manipulation simply because the data source has changed.

4. PHP-GTK

PHP's bread and butter has long been its ability to create powerful, dynamic Web sites. But what about desktop applications? That's precisely the PHP-GTK project's intent, and I guarantee you'll be surprised by just how far you can push PHP's boundaries in this regard. Thanks to this project's PHP implementation of the GTK+ language bindings, you can create applications as sophisticated as the Teak Email client presented in Figure 1.

The Teak Email Client
Figure 1. The Teak Email Client
(source: Teak website)

Although it appears as if progress on the PHP-GTK project has slowed as of late, the years of development that have already gone into PHP-GTK have left it an immensely capable project.

5. Quercus

A few years ago Neal Ford penned a blog post that to this day has had a major impact on the way I think about programming. The post, titled "Polyglot programming," promoted the idea that using multiple languages to power a web application will actually decrease rather than increase its complexity because you'll be able to selectively use each language to implement features that would be hard to implement in other languages.

Enter Quercus, a 100% Java implementation of the PHP 5 language. This implementation opens up a whole new world of possibilities for both PHP and Java developers, allowing PHP developers to take advantage of technologies such as Hibernate and Spring, while giving Java developers the opportunity to use PHP's vast assortment of extensions such as SimpleXML and PDF.

6. Php.js

Ajax-enhanced websites have become the norm these days thanks to the popularity of libraries such as jQuery. These libraries greatly reduce the amount of time and frustration that would otherwise be required to create these powerful enhancements, because the libraries implement many features that native JavaScript alone does not support.

Php.js further enhances JavaScript's capabilities by making many of PHP's most popular functions accessible from within JavaScript, including date() and wordwrap(). Not intended to be a port of PHP to JavaScript, php.js instead seeks to enhance JavaScript where the language is weak and not interfere otherwise.

Check out the impressive number of functions php.js has already implemented to get a feel for just how much work has gone into this project.

7. Qwench

The 2008 release of Stack Overflow surprised developers around the world by reinventing the age-old discussion forum. The site and the many network websites that have launched via the StackExchange service have rapidly risen through the ranks to sit among the most highly trafficked in the world.

With success comes imitation, and we've seen a number of Stack Overflow clones implemented in a variety of languages during the past two years. One of the most interesting PHP-specific implementations is Anant Garg's Qwench, a self-proclaimed "PHP StackOverflow Clone."

Although apparently functional (see this demo), it doesn't appear as if Anant has worked on Qwench in recent months. However, because it's hosted on GitHub maybe another contributor will help kickstart the project anew!

8. Phergie

Whether you're an open source user or contributor, chances are you've spent a fair amount of time chatting with others over IRC. Because of IRC's popularity, developers have written a number of "bots" capable of programmatically responding to IRC-initiated events. For instance, bots have been created as AI experiments, gaming partners and chat room facilitators.

If you're looking for a PHP-driven IRC bot, check out Phergie, a recently launched project that has been under rapid development for the past several months and has recently become part of Luke Fitzgerald's Google Summer of Code project. Check out Phergie's GitHub repository to download the code and monitor progress.

9. Vim-debug

As we all know, vi won the Editor Wars years ago. If you're a member of this victorious party, check out vim-debug, an integrated debugging environment that integrates with xdebug to create an even more powerful PHP development environment than has already long been offered by vim (see Andrei Zmievski's great presentation VIM for PHP Programmers if you'd like to learn more about what's possible).

10. PHPInteractiveShell

I've long envied the Interactive Ruby Shell, which provides a great way to quickly experiment with Ruby code. It appears as if Geoffrey Bachelet has taken a giant step towards implementing a similar solution for PHP developers thanks to his release of PHPInteractiveShell. Although it appears as if development has slowed in recent months, hopefully other users will pick up the ball and run with what looks like a great start on a promising new project!

Conclusion

PHP users have historically been a rather independent bunch, and these ten wild projects indicate that over the years that mindset hasn't disappeared. Are you working on a wild PHP project, or know of one not mentioned here? Tell us about it in the comments!

About the Author

Jason Gilmore is founder of WJGilmore.com. He also is the author of several popular books, including "Easy PHP Websites with the Zend Framework", "Easy PayPal with PHP", and "Beginning PHP and MySQL, Third Edition".

Sitemap | Contact Us

Thanks for your registration, follow us on our social networks to keep up-to-date