Due to my work and my academia commitments I find myself very often switching from Ruby to PHP and back again. This is making me more and more accustomed to the substantial differences between these two languages.
Among these differences the handling of collections is perhaps one of the biggest I found till now.
For example in Ruby there is a module (i.e. an object) called Enumerable that exposes a lot of useful helpers and utilities to work with collections (i.e. objects).
While working on a collection of objects, in particular a Nokogiri::XML::NodeSet, I recently had the need to extend the map behavior to get a collection of non duplicated Nokogiri::XML::Node elements.