Functional\Tests\ZipTest::testZippingWithCallback PHP Method

testZippingWithCallback() public method

    public function testZippingWithCallback()
    {
        $result = ['one1-11', 'two2-2', 'three3-3'];
        $this->assertSame($result, zip(['one', 'two', 'three'], [1, 2, 3], [-1, -2, -3], [true, false], function ($one, $two, $three, $four) {
            return $one . $two . $three . $four;
        }));
        $this->assertSame($result, zip(new ArrayIterator(['one', 'two', 'three']), new ArrayIterator([1, 2, 3]), new ArrayIterator([-1, -2, -3]), new ArrayIterator([true, false]), function ($one, $two, $three, $four) {
            return $one . $two . $three . $four;
        }));
    }