LINQ for PHP (Language Integrated Query for PHP)
On his blog, Maarten Balliauw started a new class library mimicing C#'s LINQ technology.
Perhaps you have already heard of C# 3.5's "LINQ" component. LINQ, or Language Integrated Query, is a component inside the .NET framework which enables you to perform queries on a variety of data sources like arrays, XML, SQL server, ... These queries are defined using a syntax which is very similar to SQL.
There is a problem with LINQ though... If you start using this, you don't want to access data sources differently anymore. Since I'm also a PHP developer, I thought of creating a similar concept for PHP. So here's the result of a few days coding:
Let's say we have an array of strings and want to select only the strings whose length is < 5. The PHPLinq way of achieving this would be the following:
// Create data source
$names = array("John", "Peter", "Joe", "Patrick", "Donald", "Eric");
$result = from('$name')->in($names)
->where('$name => strlen($name) < 5')
->select('$name');
Feels familiar to SQL? Yes indeed! No more writing a loop over this array, checking
the string's length, and adding it to a temporary variable.
Read more about this and get familiar with this useful technology.

Comments
Even if I look at the examples on the page, I don't get why this should be more convenient than using a foreach-loop and a couple of if-statements.
I can even use objects if they extend the ArrayIterator class, so why exactly should I use PHPLinq?
Really looking forward to using it :)