The Developer.com article I wrote last year, 10 Experimental PHP Projects Pushing the Envelope, was originally intended to be little more than an homage to nontraditional PHP efforts that stretched beyond standard Web application development tools such as PHP-GTK and phpList. However, upon further investigation, it soon became clear that the PHP community was stretching PHP's capabilities far beyond client-side development and newsletter administration, creating Lisp implementations, IRC bots, and interactive shells. Not only did this article turn out to be very entertaining to write, but it wound up being one of the most popular articles I wrote for Developer.com in 2010.
Entering the new year I wondered whether still other crazy and experimental PHP projects existed that I hadn't encountered the first time around. As it turns out, plenty of others exist. In this article I highlight nine more projects guaranteed to pique your interest.
1. PHP For Android
Although the iPhone and iPad dominate today's Zeitgeist, Android-driven competitors such as the Galaxy Tab are steadily capturing a greater share of the market, led notably by the already strong and growing Android-based smartphone and tablet market.
If you'd like to learn more about PHP for Android, check out the introductory tutorial, Build Your First PHP for Android Application by Keith Vance.
Certain database tasks involve a greater degree of complexity than can be accomplished using a standard SQL statement. To accomodate this complexity, many database solutions support stored procedures, which encapsulate the logic required to complete the task within a subroutine. The subroutine behaves much like any function found within a programming language such as PHP.
While these procedures can be written using SQL syntax (which you may not be aware includes both conditional and looping syntax), many database solutions support the ability to write stored procedures using other languages. For instance, PostgreSQL can execute stored procedures written in C, C++, Java, Ruby, Perl, and Python, among other languages. Thanks to the PL/php project, you can write stored procedures using the PHP language!
When you have PL/php installed, you'll be able to define and execute PHP-driven stored procedures within PostgreSQL just as you can with any other supported language. This allows you to take advantage of PHP's familiar conditional, looping, and array syntax throughout.
My original article 10 Experimental PHP Projects Pushing the Envelope mentioned the PHP-GTK project, which allows you to write desktop applications thanks to the project's implementation of the GTK+ bindings. To date, developers have used PHP-GTK to create games, blogging software, chat clients, and even a full-blown mail client.
The PHP-Qt project offers similar capabilities to Qt developers, providing an object-oriented interface to Qt 4. Although a very interesting idea, it appears as if this project has not been actively maintained in recent years, so digging up additional details was next to impossible. If you're using PHP-Qt, tell us about your experience in the comments!
Earlier this year, Ruby core team member Aaron Patterson released phuby, a proof-of-concept gem that makes it possible to run PHP code within Rails applications. Although Aaron has created several videos demonstrably proving phuby's ability to run PHP code from within Rails, his tongue-in-cheek Ruby mailing list message announcing phuby's release indicates that doing so might not be such a desirable feature within the Rails community after all.
5. The Other Phuby
Sean Huber also released a project named phuby, which bears no relation to the previous project although it shares a PHP/Ruby focus. This phuby adds several interesting Ruby features to the PHP language simply by adding the phuby project to your PHP installation's
include_path. Although still in the early stages of development, phuby already brings Ruby mixins to PHP, splat capabilities, and send and respond_to methods, among other features. Planned features include adding alias_method and alias_method_chain.