PHPackages                             remorhaz/php-json-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. remorhaz/php-json-parser

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

remorhaz/php-json-parser
========================

JSON (RFC 8259) parser written in PHP

04PHP

Since May 9Pushed 8y ago1 watchersCompare

[ Source](https://github.com/remorhaz/php-json-parser)[ Packagist](https://packagist.org/packages/remorhaz/php-json-parser)[ RSS](/packages/remorhaz-php-json-parser/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP JSON parser
===============

[](#php-json-parser)

[![License](https://camo.githubusercontent.com/a8db9fbb6b224ec55a0c6c0eab78247106b7fdee27fb58fd6d684af2d77b79c6/68747470733a2f2f706f7365722e707567782e6f72672f72656d6f7268617a2f7068702d6a736f6e2d7061727365722f6c6963656e7365)](https://packagist.org/packages/remorhaz/php-json-parser)[![Latest Stable Version](https://camo.githubusercontent.com/3313e153261189671df71d5e08a40f7b67ba56b8425568323ec7a877f140da54/68747470733a2f2f706f7365722e707567782e6f72672f72656d6f7268617a2f7068702d6a736f6e2d7061727365722f762f737461626c65)](https://packagist.org/packages/remorhaz/php-json-parser)[![Maintainability](https://camo.githubusercontent.com/5313050068163fd05d4f5570879f0fd8c0d6011e65af2701b1a0c3ff4e59ee9f/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f61656239386164323434393963643138376364352f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/remorhaz/php-json-parser/maintainability)[![Test Coverage](https://camo.githubusercontent.com/617677bcbdb779b5cac262f9a1b0f3a6507b32aa08ea17e887d56ebedc717ab9/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f61656239386164323434393963643138376364352f746573745f636f766572616765)](https://codeclimate.com/github/remorhaz/php-json-parser/test_coverage)

JSON (RFC 8259) streaming push-parser written in PHP.

Requirements
------------

[](#requirements)

- PHP 7.1+

License
-------

[](#license)

This library is licensed under MIT license.

Installation
------------

[](#installation)

Installation is as simple as any other [composer](https://getcomposer.org/) library's one:

```
composer require remorhaz/php-json-parser

```

Usage
-----

[](#usage)

At first you need to implement `Remorhaz\JSON\Parser\Stream\EventListenerInterface` in your listener object. In most cases you can just extend `Remorhaz\JSON\Parser\Stream\AbstractEventListener` class and override any of its methods.

Then you pass your listener instance as an argument to `Remorhaz\JSON\Parser\Parser` class constructor. Now all you need is calling parser's `parse()` method with some valid JSON string, and it will start triggering listener's methods on corresponding events.

### Example

[](#example)

Let's create a simple listener that concatenates all string values from given JSON string.

```
