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     {

        fseek($this->output->getStream(), 0);



        $output = stream_get_contents($this->output->getStream());



        $output = Preg::replaceCallback("{(?<=^|\n|\x08)(.+?)(\x08+)}", function ($matches) {

            $pre = strip_tags($matches[1]);
<?php                 }

                $statusCode = $progress['http_code'];

                rewind($job['headerHandle']);

                $headers = explode("\r\n", rtrim(stream_get_contents($job['headerHandle'])));

                fclose($job['headerHandle']);



                if ($statusCode === 0) {
<?php                     $contents = $job['filename'].'~';

                    if ($statusCode >= 300) {

                        rewind($job['bodyHandle']);

                        $contents = stream_get_contents($job['bodyHandle']);

                    }

                    $response = new CurlResponse(array('url' => $progress['url']), $statusCode, $headers, $contents, $progress);

                    $this->io->writeError('['.$statusCode.'] '.Url::sanitize($progress['url']), true, IOInterface::DEBUG);
<?php                     $this->io->writeError('['.$statusCode.'] '.Url::sanitize($progress['url']), true, IOInterface::DEBUG);

                } else {

                    rewind($job['bodyHandle']);

                    $contents = stream_get_contents($job['bodyHandle']);

                    $response = new CurlResponse(array('url' => $progress['url']), $statusCode, $headers, $contents, $progress);

                    $this->io->writeError('['.$statusCode.'] '.Url::sanitize($progress['url']), true, IOInterface::DEBUG);

                }
<?php         $stream = $zip->getStream($configurationFileName);



        if (false !== $stream) {

            $content = stream_get_contents($stream);

        }



        $zip->close();
<?php         }



        $output = str_replace("\r", '', $io->getOutput());

        $this->assertEquals($expectResult, $result, $output . stream_get_contents($appOutput));

        if ($expectLock && isset($actualLock)) {

            unset($actualLock['hash'], $actualLock['content-hash'], $actualLock['_readme'], $actualLock['plugin-api-version']);

            $this->assertEquals($expectLock, $actualLock);