$options can be array or Traversable accord to the docblock but this code only will work with arrays. It's necessary convert the iterator to array first (http://php.net/manual/en/function.iterator-to-array.php)