<?php rewind(resource $stream): bool
<?php public function truncate() { rewind($this->handle); ftruncate($this->handle, 0);
<?php } fwrite($sink, $body); rewind($sink); }; }
<?php $string = 'Look at me, i am a stream!!'; $resource = fopen('php://temp', 'w'); fwrite($resource, $string); rewind($resource); $body = Utils::streamFor($resource); $fakeRequest = function (Request $request) use ($string) {
<?php new StreamedResponse(function () { $stream = fopen('php://memory', 'r+'); fwrite($stream, 'expected response data'); rewind($stream); fpassthru($stream); }) );