When outputting a table, a common task is to alternate the row colours to give a zebra effect - an effect commonly said (though debated) to increase readability.
A novel solution to this problem involves using PHP5’s new __toString method: introducing Cycle.
Thus with minimal effort, simply echoing the string will seemingly magically alternate between the specified outputs. An example:
This would output:
</code>
And there we have it, zebra striped tables without a messy counter or other tricks.