Skip to content

StreamFactory: createStream Example

Terry L edited this page Jun 18, 2020 · 4 revisions

createStream($content)

  • param string content = "" String content with which to populate the stream.
  • return StreamInterface

Example:

$streamFactory = new StreamFactory();
$stream = $streamFactory->createStream('Foo Bar');

echo $stream;
// Outputs: Foo Bar
Clone this wiki locally