Example #1
0
 /**
  * @chainable
  * @category  Arrays
  * @param     array  $xs
  * @return    Iterator
  */
 public static function reverse($xs)
 {
     return new Iterator\DeferIterator(function () use($xs) {
         return new \ArrayIterator(ArrayImpl::reverse($xs));
     });
 }
Example #2
0
 /**
  * @chainable
  * @category  Arrays
  * @param     array  $xs
  * @return    Generator
  */
 public static function reverse($xs)
 {
     foreach (ArrayImpl::reverse($xs) as $x) {
         (yield $x);
     }
 }