PHPackages                             halaxa/json-machine - 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. halaxa/json-machine

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

halaxa/json-machine
===================

Efficient, easy-to-use and fast JSON pull parser

1.2.6(6mo ago)1.3k23.9M↓49%74[5 issues](https://github.com/halaxa/json-machine/issues)20Apache-2.0PHPPHP 7.2 - 8.5CI failing

Since Nov 12Pushed 2mo ago19 watchersCompare

[ Source](https://github.com/halaxa/json-machine)[ Packagist](https://packagist.org/packages/halaxa/json-machine)[ Fund](https://ko-fi.com/G2G57KTE4)[ RSS](/packages/halaxa-json-machine/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (3)Versions (43)Used By (20)

[![JSON Machine](img/github.png)](img/github.png)
=================================================

[](#)

Very easy to use and memory efficient drop-in replacement for inefficient iteration of big JSON files or streams for PHP &gt;=7.2. See [TL;DR](#tl-dr). No dependencies in production except optional `ext-json`. README in sync with the code

[![Build Status](https://github.com/halaxa/json-machine/actions/workflows/makefile.yml/badge.svg)](https://github.com/halaxa/json-machine/actions)[![codecov](https://camo.githubusercontent.com/6f85bb9a7f66f622c44cd7931667c15cebd7c8a29ae8eaaac63695e64a329a73/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f67682f68616c6178612f6a736f6e2d6d616368696e653f6c6162656c3d706870756e6974253230253430636f76657273)](https://codecov.io/gh/halaxa/json-machine)[![Latest Stable Version](https://camo.githubusercontent.com/f0a613c51a2f9ab55e6debdafd66ee19b9b34f96e7bc66a75d1369c168194d3e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f68616c6178612f6a736f6e2d6d616368696e653f636f6c6f723d626c756576696f6c657426696e636c7564655f70726572656c6561736573266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/halaxa/json-machine)[![Monthly Downloads](https://camo.githubusercontent.com/95796af2697847b6453caec334cffcccbf39e20b83771ac2aa51e3cfe7f19802/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68616c6178612f6a736f6e2d6d616368696e653f636f6c6f723d253233663238643161)](https://packagist.org/packages/halaxa/json-machine)

---

NEW in version `1.2.0` - [Recursive iteration](#recursive)

---

- [TL;DR](#tl-dr)
- [Introduction](#introduction)
- [Parsing JSON documents](#parsing-json-documents)
    - [Parsing a document](#simple-document)
    - [Parsing a subtree](#parsing-a-subtree)
    - [Parsing nested values in arrays](#parsing-nested-values)
    - [Parsing a single scalar value](#getting-scalar-values)
    - [Parsing multiple subtrees](#parsing-multiple-subtrees)
    - [Recursive iteration](#recursive)
    - [What is JSON Pointer anyway?](#json-pointer)
- [Options](#options)
- [Parsing streaming responses from a JSON API](#parsing-json-stream-api-responses)
    - [GuzzleHttp](#guzzlehttp)
    - [Symfony HttpClient](#symfony-httpclient)
- [Tracking the progress](#tracking-parsing-progress)
- [Decoders](#decoders)
    - [Available decoders](#available-decoders)
- [Error handling](#error-handling)
    - [Catching malformed items](#malformed-items)
- [Parser efficiency](#on-parser-efficiency)
    - [Streams / files](#streams-files)
    - [In-memory JSON strings](#in-memory-json-strings)
- [Troubleshooting](#troubleshooting)
    - ["I'm still getting Allowed memory size ... exhausted"](#step1)
    - ["That didn't help"](#step2)
    - ["I am still out of luck"](#step3)
- [Installation](#installation)
- [Development](#development)
    - [Non containerized](#non-containerized)
    - [Containerized](#containerized)
- [Support](#support)
- [License](#license)

---

TL;DR
-----

[](#tldr)

```
