Browse Source

Merge pull request #6749 from antograssiot/php7

don't modify args before calling `func_get_args()`
José Lorenzo Rodríguez 10 years ago
parent
commit
766d7849a1
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/Collection/CollectionTrait.php

+ 2 - 1
src/Collection/CollectionTrait.php

@@ -587,10 +587,11 @@ trait CollectionTrait
      */
     public function zipWith($items, $callable)
     {
-        $items = [$items];
         if (func_num_args() > 2) {
             $items = func_get_args();
             $callable = array_pop($items);
+        } else {
+            $items = [$items];
         }
         return new ZipIterator(array_merge([$this], $items), $callable);
     }