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

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

umulmrum/json-parser
====================

A library that parses JSON as stream.

0.4.0(5y ago)2124MITPHPPHP &gt;=7.1CI failing

Since Apr 15Pushed 5y ago1 watchersCompare

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

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

JSON Parser
===========

[](#json-parser)

JSON Parser is a streaming JSON parsing library. It returns the same results as `\json_decode('some-string', true, 512, JSON_UNESCAPED_SLASHES)`.

You might want to use this library when decoding JSON that is multiple MiB in size, where the in-memory approach of `\json_decode()` consumes excessive amounts of memory. This library has constant memory usage independent of the size of the JSON string if used correctly (which is not difficult, see below).

You might NOT want to use this library for small JSON strings of less than ~1 MiB, as `\json_decode()` is about 50x faster. While I aim for performance improvements, the C implementation of `\json_decode()` will always be faster than this PHP implementation.

[![Latest Stable Version](https://camo.githubusercontent.com/e80d8fe9a68f56c573033e9d01093a82072b54d6ad308e218726f0f8af75e1d8/68747470733a2f2f706f7365722e707567782e6f72672f756d756c6d72756d2f6a736f6e2d7061727365722f76657273696f6e)](https://packagist.org/packages/umulmrum/json-parser)[![Latest Unstable Version](https://camo.githubusercontent.com/adda74a3e6cdc198c70482319bee8ee68845dead2a13d10e16d357edeb8cbf5d/68747470733a2f2f706f7365722e707567782e6f72672f756d756c6d72756d2f6a736f6e2d7061727365722f762f756e737461626c65)](https://packagist.org/packages/umulmrum/json-parser)[![License](https://camo.githubusercontent.com/ea2dbac80e5b0184a200dacc2e7b9398ae77e9a4188b0c0eb381306f674a7b6d/68747470733a2f2f706f7365722e707567782e6f72672f756d756c6d72756d2f6a736f6e2d7061727365722f6c6963656e7365)](https://packagist.org/packages/umulmrum/json-parser)[![Build Status](https://camo.githubusercontent.com/ce99cafc943236ab08da1eab314796259462e30285d5579e4ab9d7979aa2e2a0/68747470733a2f2f7472617669732d63692e6f72672f756d756c6d72756d2f6a736f6e2d7061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/umulmrum/json-parser)

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

[](#requirements)

- PHP &gt;= 7.1

That's it really. However, using the mb\_string extension will improve performance.

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

[](#installation)

Install the library using Composer.

```
composer require umulmrum/json-parser

```

Status
------

[](#status)

This library is in beta state. Code coverage in unit tests is high and the library is already used in production, but it is not yet considered stable; you are encouraged to test it and report issues.

Usage
-----

[](#usage)

```
