NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #659 most downloaded on Packagist
Efficient, easy-to-use and fast JSON pull parser
Latest stable
1.2.6
Last release 11 months ago
05 Dec 2025
Release timing varies
gaps range from 2 weeks to 1.1 years
Nearly every release is documented
notes for 29 of 30 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
32 releases · first in 2018
Drag across the ruler to compare, or tap a release to open it.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
<br>
Your coding agent can read these notes before it upgrades. Set up the MCP server →
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
<br>
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
<br>
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
RecursiveItems. See Recursive iteration in README.<br>
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
<br>
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
<br>
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
make performance-tests<br>
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
objects() and httpClientChunks().JsonMachine entrypoint class. Use Items instead.Decoder interface. Use ItemDecoder instead.Parser::getJsonPointer(). Use Parser::getJsonPointers()/Items::getJsonPointers() instead.Parser::getJsonPointerPath(). No replacement. Was not useful for anything other than testing and exposed internal implementation.Items::fromString(
'{"quotes\"": [1, 2, 3]}',
- ['pointer' => '/quotes"']
+ ['pointer' => '/quotes\"']
);
ItemDecoder::decodeInternalKey() was deleted as well as related ValidStringResult.
They are not used anymore as described in previous point.PassThruDecoder does not decode keys anymore. Both the key and the value yielded are raw JSON now.Parser is object. (You won't notice that unless you use Parser class directly)SyntaxError renamed to SyntaxErrorExceptionItems::__construct accepts the options array instead of separate arguments. (You won't notice that unless you instantiate Items class directly)Lexer renamed to TokensDebugLexer renamed to TokensWithDebuggingpointer option. See README. Thanks @fwolfsjaeger.Items::getCurrentJsonPointer() and Items::getMatchedJsonPointer()
to track where you are. See README. Thanks @fwolfsjaeger.TokensWithDebugging::getPosition(). Was constantly off by 1-2 bytes.<br>
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
ItemDecoder. ErrorWrappingDecoder decorator now requires ItemDecoder as well.JsonMachine\JsonMachine entry point class is deprecated, use JsonMachine\Items instead.JsonMachine\JsonDecoder\Decoder interface is deprecated. Use JsonMachine\JsonDecoder\ItemDecoder instead.Items replaces JsonMachine.Items.Items::getIterator() now returns Parser's iterator directly. Call Items::getIterator()
instead of JsonMachine::getIterator()::getIterator() to get to Parser's iterator if you need it. Fixes
https://stackoverflow.com/questions/63706550Items uses options in its factory methods instead of growing number of many parameters. See Options in README.Items introduces new debug option. See Options in README.0.7.* takes about 7 seconds in 0.8.0.<br>
Further performance and code improvements. See the CHANGELOG. Please leave your comments in the 0.8.0-BETA discussion.
Further performance and code improvements. See the CHANGELOG. Please leave your comments in the 0.8.0-BETA discussion.
See the CHANGELOG. Please leave your comments in the 0.8.0-BETA discussion.
See the CHANGELOG. Please leave your comments in the 0.8.0-BETA discussion.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
<br>
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
- in json pointer as a wildcard for an array index. Example: /users/-/id. Thanks @cerbero90<br>
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
} did not set object key expectation to false. (#41 via PR #42).<br>
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
<br>
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
FileChunks class. Takes care of the proper resource management when iterating via JsonMachine::fromFile().
It is used internally, and you probably won't come across it.ErrorWrappingDecoder. Use it when you want to skip malformed JSON items. See Decoders.StreamBytes and StringBytes renamed to StreamChunks and StringChunks.
These are internal classes, and you probably won't notice the change
unless you use them directly for some reason.<br>
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
See CHANGELOG for changes and release notes.
ext-json is not required in composer.json anymore, because custom decoder might not need it.
However built-in decoders depend on it so it must be present if you use them.JsonMachineException (thanks @gabimem)UnexpectedEndSyntaxErrorException on an unexpected end of JSON structure (thanks @gabimem)httpClientChunks() is deprecated so that compatibility with Symfony HttpClient
is not on the shoulders of JSON Machine maintainer. The code is simple and everyone can make their own
function and maintain it. The code was moved to examples.objects() is deprecated. The way objects() works is that it casts decoded arrays
to objects. It brings some unnecessary overhead and risks on huge datasets.
Alternative is to use ExtJsonDecoder which decodes items as objects by default (same as json_decode).<?php
use JsonMachine\JsonDecoder\ExtJsonDecoder;
use JsonMachine\JsonMachine;
$jsonMachine = JsonMachine::fromFile('path/to.json', '', new ExtJsonDecoder);
Therefore no additional casting is required.
Minor feature: JsonMachine::fromIterable() - an alias to constructor, but emphasizing the fact that an iterable can be a source of json data. Very han
Minor feature: JsonMachine::fromIterable() - an alias to constructor, but emphasizing the fact that an iterable can be a source of json data. Very handy in conjunction with Symfony HttpClient and new httpClientChunks helper. See example in src/examples.
Also PHP 7.4 support
#6, thanks @Mwisho #14, thanks @formatz #19, thanks @LaravelFreelancerNL
### New Features (0) ### Bug Fixes (1) #9 Fixed json parsing with "\\" at the end of a string. Thanks, @marenkov. ### BC breaks (0)
#9 Fixed json parsing with "\\" at the end of a string. Thanks, @marenkov.
Docker: Each PHP docker image has xdebug installed Docker: Testing script tries to pull the newest image of each supported php version Docker: Updated
Docker: Each PHP docker image has xdebug installed Docker: Testing script tries to pull the newest image of each supported php version Docker: Updated PHP 7.3 version to stable
Json pointer was failing when iterated subtree was not the first at its level #7. Thanks, @rybakit.
Fixed json_decode call on performace test to return array same as JsonMachine
Got rid of the quiet dependency on local ./composer binary
Reworded guzzle example #3. Thanks, @Mwisho.
Only lower case of null, true and false is allowed - was non standard and shouldn't affect anyone
Support for + sign in front of positive number was dropped - was non standard and shouldn't affect anyone
JsonMachine::fromString now consumes about 4× less memory than previous version, by utilizing PHP's copy on write behaviour. JSON string is not copied
Lexer has changed. It newly requires \Traversable instead of a stream resource. It doesn't affect public JsonMachine API.License, readme and logo changes.
License, readme and logo changes.
Tests all supported PHP versions via Docker
Nothing published for this version
One column per quarter.