Php Stringstream data structure.
composer require ltd-beget/stringstream
<?php
use LTDBeget\stringstream\StringStream;
require(__DIR__ . '/vendor/autoload.php');
$stream = new StringStream("Hello, World!");
do {
if($stream->currentAscii()->isWhiteSpace()) {
$stream->ignoreWhitespace();
} else {
echo $stream->current().PHP_EOL;
$stream->next();
}
} while (! $stream->isEnd());
released under the MIT License. See the bundled LICENSE file for details.