PackageTrack
Sign in Get early access

halaxa/json-machine

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

1.2.6 27M downloads/mo #674 most downloaded on Packagist halaxa/json-machine

What this package is like to depend on

Last release 8 months ago

05 Dec 2025

Release timing varies

gaps range from 2 weeks to 1.1 years

Most releases are documented

notes for 23 of 30 stable releases

Nothing withdrawn

no release was ever pulled

8 years old

32 releases · first in 2018

1 release in the last 12 months

see the full history below

Release timeline

32 releases · Nov 2018 to Dec 2025
2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 32
  1. 1.2.6 05 Dec 2025
    Release notes

    See CHANGELOG for changes and release notes.

    Open source →
    Release notes
    • Support for PHP 8.5

    <br>

    Open source →
  2. 1.2.5 07 Jul 2025
    Release notes

    See CHANGELOG for changes and release notes.

    Open source →
    Release notes
    • Slight performance optimization of the tokenizing process (about +7 % speed gain)

    <br>

    Open source →
  3. 1.2.4 16 Jun 2025
    Release notes

    See CHANGELOG for changes and release notes.

    Open source →
    Release notes

    Fixed

    <br>

    Open source →
  4. 1.2.3 30 May 2025
    Release notes

    See CHANGELOG for changes and release notes.

    Open source →
    Release notes
    • Tokenizer completely rewritten to use regular expressions for partial tokenization. Got rid of per-byte processing in PHP code. Standard parsing speed boost (non-recursive, non-debug) about + 50 %. Further improvements on the way.

    <br>

    Open source →
  5. 1.2.2 30 Apr 2025
    Release notes

    See CHANGELOG for changes and release notes.

    Open source →
    Release notes

    Changed

    <br>

    Open source →
  6. 1.2.1 25 Apr 2025
    Release notes

    See CHANGELOG for changes and release notes.

    Open source →
    Release notes

    Fixed

    • File autoloading without composer (#122). Thanks @bahco
    • Crash on null value in RecursiveItems (#119). Thanks @bark92 <br>
    Open source →
  7. 1.2.0 24 Nov 2024
    Release notes

    See CHANGELOG for changes and release notes.

    Open source →
    Release notes

    Added

    • Recursive iteration via new facade RecursiveItems. See Recursive iteration in README.

    <br>

    Open source →
  8. 1.1.5 22 Nov 2024
    Release notes

    See CHANGELOG for changes and release notes.

    Open source →
    Release notes

    Added

    • Support for PHP 8.4
    • Exception on misspelled option name suggests a correct one.

    Fixed

    • Wrong key when combining list and scalar value pointers (#110). Thanks @daniel-sc

    Removed

    • Removed support for PHP 7.0, 7.1 <br>
    Open source →
  9. 1.1.4 28 Nov 2023
    Release notes

    See CHANGELOG for changes and release notes.

    Open source →
    Release notes
    • Minor fixes and added some tests.

    Added

    • Support for PHP 8.3
    • Added PHPStan to build pipeline

    Fixed

    • Fixed the case when non-intersecting pointers were considered intersecting (#106). Thanks @XedinUnknown

    <br>

    Open source →
  10. 1.1.3 12 Oct 2022
    Release notes

    See CHANGELOG for changes and release notes.

    Open source →
    Release notes

    Fixed

    • Fix the parsing of nested sub-trees that use wildcards (#83). Thanks @cerbero90

    <br>

    Open source →
  11. 1.1.2 29 Sep 2022
    Release notes

    Added

    • PHP 8.2 support

    Fixed

    • Meaningful error on invalid token. (#86)
    • Added missing return type annotation. (#84)

    <br>

    Open source →
  12. 1.1.1 03 Mar 2022
    Release notes

    Fixed

    • Fixed warning when generating autoload classmap via composer.

    <br>

    Open source →
  13. 1.1.0 19 Feb 2022
    Release notes

    Added

    • Autoloading without Composer. Thanks @a-sync.

    <br>

    Open source →
  14. 1.0.1 05 Feb 2022
    Release notes

    Fixed

    • Broken command make performance-tests
    • Slight performance improvements

    <br>

    Open source →
  15. 1.0.0 04 Feb 2022
    Release notes

    Removed

    • Removed deprecated functions objects() and httpClientChunks().
    • Removed deprecated JsonMachine entrypoint class. Use Items instead.
    • Removed deprecated Decoder interface. Use ItemDecoder instead.
    • Removed Parser::getJsonPointer(). Use Parser::getJsonPointers()/Items::getJsonPointers() instead.
    • Removed Parser::getJsonPointerPath(). No replacement. Was not useful for anything other than testing and exposed internal implementation.

    Changed

    Simplified and fixed decoding

    • JSON Pointer parts between slashes (a.k.a reference tokens) must be valid encoded JSON strings to be JSON Pointer RFC 6901 compliant. It means that no internal key decoding is performed anymore. You will have to change your JSON Pointers if you match against keys with escape sequences.
    Items::fromString(
        '{"quotes\"": [1, 2, 3]}',
    -   ['pointer' => '/quotes"']
    +   ['pointer' => '/quotes\"']
    );
    
    • Method 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.

    Other

    • Default decoding structure of Parser is object. (You won't notice that unless you use Parser class directly)
    • SyntaxError renamed to SyntaxErrorException
    • Items::__construct accepts the options array instead of separate arguments. (You won't notice that unless you instantiate Items class directly)
    • Lexer renamed to Tokens
    • DebugLexer renamed to TokensWithDebugging

    Added

    • Multiple JSON Pointers can be specified as an array in pointer option. See README. Thanks @fwolfsjaeger.
    • New methods available during iteration: Items::getCurrentJsonPointer() and Items::getMatchedJsonPointer() to track where you are. See README. Thanks @fwolfsjaeger.

    Fixed

    • Incorrect position information of TokensWithDebugging::getPosition(). Was constantly off by 1-2 bytes.

    <br>

    Open source →
  16. 0.8.0 07 Jan 2022
    Release notes

    Changed

    • Internal decoders moved to ItemDecoder. ErrorWrappingDecoder decorator now requires ItemDecoder as well.
    • Dropped PHP 5.6 support.

    Deprecated

    • JsonMachine\JsonMachine entry point class is deprecated, use JsonMachine\Items instead.
    • JsonMachine\JsonDecoder\Decoder interface is deprecated. Use JsonMachine\JsonDecoder\ItemDecoder instead.

    Added

    • New entry point class Items replaces JsonMachine.
    • Object as default decoding structure instead of array in 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/63706550
    • Items 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.
    • Noticeable performance improvements. What took 10 seconds in 0.7.* takes about 7 seconds in 0.8.0.

    <br>

    Open source →
  17. 0.8.0-BETA2 04 Jan 2022 pre-release

    Nothing published for this version

  18. 0.8.0-BETA 24 Dec 2021 pre-release

    Nothing published for this version

  19. 0.7.1 06 Dec 2021
    Release notes

    New features

    • PHP 8.1 support
    • DEV: Build system switched to composer scripts and Makefile

    <br>

    Open source →
  20. 0.7.0 06 May 2021
    Release notes

    New features

    • Use a - in json pointer as a wildcard for an array index. Example: /users/-/id. Thanks @cerbero90

    <br>

    Open source →
  21. 0.6.1 06 Apr 2021
    Release notes

    Fixed bugs

    • Empty dict at the end of an item was causing Syntax error in the next item. Reason: closing } did not set object key expectation to false. (#41 via PR #42).

    <br>

    Open source →
  22. 0.6.0 24 Jan 2021
    Release notes

    New features

    • New: Json pointer can find scalar values in JSON document as well as iterable values. See Getting single scalar values
    • Parser ends when the end of the desired data is reached and does not heat up the atmosphere further.
    • Optimizations: about 15% speed gain.

    BC breaks

    • A json pointer that matches scalar value does not throw anymore, but the scalar value is yielded in foreach.

    <br>

    Open source →
  23. 0.5.0 08 Dec 2020
    Release notes

    New features

    • Introduced 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.
    • New ErrorWrappingDecoder. Use it when you want to skip malformed JSON items. See Decoders.

    BC breaks

    • 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>

    Open source →
  24. 0.4.1 01 Dec 2020
    Release notes

    New features

    • Tracking of parsing progress

    <br>

    Open source →
  25. 0.4.0 09 Nov 2020
    Release notes

    New features

    BC breaks

    • 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.
    • All exceptions now extend JsonMachineException (thanks @gabimem)
    • Throws UnexpectedEndSyntaxErrorException on an unexpected end of JSON structure (thanks @gabimem)
    • Function 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.
    • Function 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.

    • Invalid json object keys will now throw and won't be ignored anymore.

    Fixed bugs

    • Decoding of json object keys checks for errors and does not silently ignore them.
    Open source →
  26. 0.3.3 20 Dec 2019

    Nothing published for this version

  27. 0.3.2 20 Mar 2019

    Nothing published for this version

  28. 0.3.1 16 Mar 2019

    Nothing published for this version

  29. 0.3.0 13 Dec 2018

    Nothing published for this version

  30. v0.2.1 29 Nov 2018

    Nothing published for this version

  31. v0.2.0 29 Nov 2018

    Nothing published for this version

  32. v0.1.0 12 Nov 2018

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive