Functional\Tests\CaptureTest::testCaptureReturnValue PHP Method

testCaptureReturnValue() public method

    public function testCaptureReturnValue()
    {
        $fn = capture(function (...$args) {
            return $args;
        }, $result);
        $this->assertSame([1, 2], $fn(1, 2));
        $this->assertSame([1, 2], $result);
    }