stream_get_contents

Supported Versions: PHP 5, PHP 7, PHP 8
Reads remainder of a stream into a string
<?php stream_get_contents(resource $stream, ?int $length = null, int $offset = -1): string|false
<?php         $this->factory->sink($resource)->get('https://example.com');



        $this->assertSame(0, ftell($resource));

        $this->assertSame('abc123', stream_get_contents($resource));

    }



    public function testSinkWhenStubbedByPath()
<?php         $this->factory->sink($resource)->get('http://foo.com/test');



        $this->assertSame(json_encode(['page' => 'foo']), stream_get_contents($resource));

    }



    public function testCanAssertAgainstOrderOfHttpRequestsWithUrlStrings()