// first we're going to test string(), rest(), pos() manipulation and the // eol, eos and bol with multiline data. $string = '0 1 2 3 4 6 7'; $s = new StringScanner($string); assert($s->string() === $string); assert($s->rest() === $string); assert($s->pos() === 0); assert(!$s->eos()); assert(!$s->eol()); assert($s->bol()); $s->terminate(); assert(!$s->bol()); assert($s->eol()); assert($s->eos()); $s->reset(); $s->pos(1); assert($s->eol()); assert(!$s->eos()); assert(!$s->bol()); $s->pos(2); // ON the newline character assert(!$s->eol()); assert(!$s->eos()); assert($s->bol());