Skip to content

Commit

Permalink
don't modify args before calling func_get_args()
Browse files Browse the repository at this point in the history
because in PHP7, func_get_args() will return the current scoped variable value
  • Loading branch information
antograssiot committed Jun 7, 2015
1 parent 0987634 commit 0dbe486
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Collection/CollectionTrait.php
Expand Up @@ -587,10 +587,11 @@ public function zip($items)
*/
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);
}
Expand Down

0 comments on commit 0dbe486

Please sign in to comment.