public function randomizeFilter($original, $offset = 0)
    {
        if (!\is_array($original)) {
            return $original;
        }

        if ($original instanceof \Traversable) {
            $original = iterator_to_array($original, false);
        }

        $sorted = [];
        $random = array_slice($original, $offset);
        shuffle($random);

        $sizeOf = \count($original);
        for ($x = 0; $x < $sizeOf; $x++) {
            if ($x < $offset) {
                $sorted[] = $original[$x];
            } else {
                $sorted[] = array_shift($random);
            }
        }

        return $sorted;
    }
public function randomizeFilter($original, $offset = 0)
    {
        if (!\is_array($original)) {
            return $original;
        }

        if ($original instanceof \Traversable) {
            $original = iterator_to_array($original, false);
        }

        $sorted = [];
        $random = array_slice($original, $offset);
        shuffle($random);

        $sizeOf = \count($original);
        for ($x = 0; $x < $sizeOf; $x++) {
            if ($x < $offset) {
                $sorted[] = $original[$x];
            } else {
                $sorted[] = array_shift($random);
            }
        }

        return $sorted;
    }
public function randomizeFilter ( $ original , $ offset = 0 ) { if ( ! \ is_array ( $ original ) ) { return $ original ; } if ( $ original instanceof \ Traversable ) { $ original = iterator_to_array ( $ original , false ) ; } $ sorted = [ ] ; $ random = array_slice ( $ original , $ offset ) ; shuffle ( $ random ) ; $ sizeOf = \ count ( $ original ) ; for ( $ x = 0 ; $ x < $ sizeOf ; $ x ++ ) { if ( $ x < $ offset ) { $ sorted [ ] = $ original [ $ x ] ; } else { $ sorted [ ] = array_shift ( $ random ) ; } } return $ sorted ; }
Returns array in a random order.

@param  array $original
@param  int   $offset Can be used to return only slice of the array.

@return array
Returns array in a random order .