PHPackages                             vistoyn/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. vistoyn/json\_parser

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

vistoyn/json\_parser
====================

PHP json parser for big files

1.1(10y ago)243MIT

Since May 26Compare

[ Source](https://github.com/vistoyn/php-json-parser)[ Packagist](https://packagist.org/packages/vistoyn/json_parser)[ Docs](https://github.com/vistoyn/php-json-stream)[ RSS](/packages/vistoyn-json-parser/feed)WikiDiscussions Synced yesterday

READMEChangelog (4)DependenciesVersions (3)Used By (0)

PHP json parser for big files
=============================

[](#php-json-parser-for-big-files)

How to install
--------------

[](#how-to-install)

```
composer require vistoyn/json_parser

```

How to update
-------------

[](#how-to-update)

```
composer update vistoyn/json_parser

```

How to use
----------

[](#how-to-use)

```
use \vistoyn\json_parser\JsonString;

/* --- Initialization --- */
$content = '
{
	"a":[1,2,3,4,5],
	"b":["a1","a2","a3","a4","a5"],
	"c":[
		{
			"key1":"val1",
			"key2":"val2",
			"key3":"val3"
		},
		{
			"key4":"val4",
			"key5":"val5",
			"key6":"val6"
		}
	],
	"d":{
		"key1":"val1",
		"key2":"val2",
		"key3":"val3"
	},
	"e":{
		"a1": [1,2,3,4,5],
		"a2": [6,7,8],
		"a3": [9,10,11,{"zz":10}],
		"a4": "str",
		"a5": null
	},
}
';

$json = new JsonString();
$json->setContent($content);

/* --- Example 1 --- */
print ("Example 1:\n");
$json->cleanRules();
$json->reset();

$json->addRule(['a', '*'], function($item, $path){
	print ("---\n");
	print ("Item: ".implode('->',$path)."\n");
	var_dump (json_decode($item, true));
});
$json->parse();
print ("\n");
print ("\n");
print ("\n");

/*
Types:
---
Item: a->0
int(1)
---
Item: a->1
int(2)
---
Item: a->2
int(3)
---
Item: a->3
int(4)
---
Item: a->4
int(5)
*/

/* --- Example 2 --- */
print ("Example 2:\n");
$json->cleanRules();
$json->reset();

$json->addRule(['b', '*'], function($item, $path){
	print ("---\n");
	print ("Item: ".implode('->',$path)."\n");
	var_dump (json_decode($item, true));
});
$json->parse();
print ("\n");
print ("\n");
print ("\n");

/*
Types:
---
Item: b->0
string(2) "a1"
---
Item: b->1
string(2) "a2"
---
Item: b->2
string(2) "a3"
---
Item: b->3
string(2) "a4"
---
Item: b->4
string(2) "a5"
*/

/* --- Example 3 --- */
print ("Example 3:\n");
$json->cleanRules();
$json->reset();

$json->addRule(['c', '*'], function($item, $path){
	print ("---\n");
	print ("Item: ".implode('->',$path)."\n");
	var_dump (json_decode($item, true));
});
$json->parse();
print ("\n");
print ("\n");
print ("\n");
/*
Types:
---
Item: c->0
array(3) {
  ["key1"]=>
  string(4) "val1"
  ["key2"]=>
  string(4) "val2"
  ["key3"]=>
  string(4) "val3"
}
---
Item: c->1
array(3) {
  ["key4"]=>
  string(4) "val4"
  ["key5"]=>
  string(4) "val5"
  ["key6"]=>
  string(4) "val6"
}
*/

/* --- Example 4 --- */
print ("Example 4:\n");
$json->cleanRules();
$json->reset();

$json->addRule(['d', '*'], function($item, $path){
	print ("---\n");
	print ("Item: ".implode('->',$path)."\n");
	var_dump (json_decode($item, true));
});
$json->parse();
print ("\n");
print ("\n");
print ("\n");
/*
Types:
---
Item: d->key1
string(4) "val1"
---
Item: d->key2
string(4) "val2"
---
Item: d->key3
string(4) "val3"
*/

/* --- Example 5 --- */
print ("Example 5:\n");
$json->cleanRules();
$json->reset();

$json->addRule(['e', '*', '*'], function($item, $path){
	print ("---\n");
	print ("Item: ".implode('->',$path)."\n");
	var_dump (json_decode($item, true));
});
$json->parse();
print ("\n");
print ("\n");
print ("\n");
/*
Types:
---
Item: e->a1->0
int(1)
---
Item: e->a1->1
int(2)
---
Item: e->a1->2
int(3)
---
Item: e->a1->3
int(4)
---
Item: e->a1->4
int(5)
---
Item: e->a2->0
int(6)
---
Item: e->a2->1
int(7)
---
Item: e->a2->2
int(8)
---
Item: e->a3->0
int(9)
---
Item: e->a3->1
int(10)
---
Item: e->a3->2
int(11)
---
Item: e->a3->3
array(1) {
  ["zz"]=>
  int(10)
}
*/
```

More see in examples/test.php

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3687d ago

Major Versions

0.2 → 1.12016-05-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/f23c4e3c275668a67824293816c8b14c1dfb9d733c43450a5a393ee85aac1eac?d=identicon)[vistoyn](/maintainers/vistoyn)

---

Top Contributors

[![ildar-ceo](https://avatars.githubusercontent.com/u/9403155?v=4)](https://github.com/ildar-ceo "ildar-ceo (8 commits)")

### Embed Badge

![Health badge](/badges/vistoyn-json-parser/health.svg)

```
[![Health](https://phpackages.com/badges/vistoyn-json-parser/health.svg)](https://phpackages.com/packages/vistoyn-json-parser)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M44](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[moonshine/layouts-field

Field for repeating groups of fields for MoonShine

108.5k](/packages/moonshine-layouts-field)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
