PHPackages                             kuria/parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. kuria/parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

kuria/parser
============

Character-by-character string parsing library

v4.0.0(7y ago)0303MITPHPPHP &gt;=7.1

Since Dec 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/kuria/parser)[ Packagist](https://packagist.org/packages/kuria/parser)[ RSS](/packages/kuria-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (8)Used By (0)

Parser
======

[](#parser)

Character-by-character string parsing library.

[![https://travis-ci.com/kuria/parser.svg?branch=master](https://camo.githubusercontent.com/f1b6c3006398989a245ae043055f4f1a50856c11ff4ba79e3bf4e9f8d568e5d6/68747470733a2f2f7472617669732d63692e636f6d2f6b757269612f7061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/kuria/parser)Contents

- [Features](#features)
- [Requirements](#requirements)
- [Usage](#usage)
    - [Creating a parser](#creating-a-parser)
    - [Parser properties](#parser-properties)
    - [Parser method overview](#parser-method-overview)
    - [Example INI parser implementation](#example-ini-parser-implementation)
- [Character types](#character-types)
    - [Customizing character types](#customizing-character-types)

[Features](#id1)
----------------

[](#features)

- line number tracking (can be disabled for performance)
- supports CR, LF and CRLF line endings
- verbose exceptions
- many methods to navigate and operate the parser
    - forward / backward peeking and seeking
    - forward / backward character consumption
    - state stack
- character types
- expectations

[Requirements](#id2)
--------------------

[](#requirements)

- PHP 7.1+

[Usage](#id3)
-------------

[](#usage)

### [Creating a parser](#id4)

[](#creating-a-parser)

Create a new parser instance with string input.

The parser begins at the first character.

```
