1. Go to this page and download the library: Download sci/stream library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sci / stream example snippets
use Sci\Stream\ArrayStream;
use Sci\Stream\IteratorStream;
// stream from array
$stream = new ArrayStream([3, 1, 4, 1, 5, 9, 2, 6, 5]);
// stream from ArrayIterator
$stream = new IteratorStream(new \ArrayIterator([2, 7, 1, 8, 2, 8]));
// stream from Generator
function generate()
{
for ($i = 0; $i < 10; ++$i) {
yield $i;
}
}
$stream = new IteratorStream(generate());