PHPackages                             im-denisenko/php-json-encode - 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. im-denisenko/php-json-encode

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

im-denisenko/php-json-encode
============================

Provides features, added to json\_encode since version 5.3.0, for version 5.3.0.

0.0.3(11y ago)1128MITPHPPHP &gt;=5.3.0

Since Jan 25Pushed 11y agoCompare

[ Source](https://github.com/im-denisenko/php-json-encode)[ Packagist](https://packagist.org/packages/im-denisenko/php-json-encode)[ RSS](/packages/im-denisenko-php-json-encode/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Future\\Json
============

[](#futurejson)

[![Build Status](https://camo.githubusercontent.com/e4dec29915bd39e48a4e6957ff68b99f052101fc0848fb8a1fc1c0c7fb0262e3/68747470733a2f2f7472617669732d63692e6f72672f696d2d64656e6973656e6b6f2f7068702d6a736f6e2d656e636f64652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/im-denisenko/php-json-encode)

Provides features, added to json\_encode since version 5.3.0, for version 5.3.0.

Reference
=========

[](#reference)

- &gt;=5.5.0 Third parameter $depth allow let you set the maximum depth.
- &gt;=5.4.0 Option JSON\_PRETTY\_PRINT let use whitespace in returned data to format it.
- &gt;=5.4.0 Option JSON\_UNESCAPED\_SLASHES let don't escape /.
- &gt;=5.4.0 Option JSON\_UNESCAPED\_UNICODE let encode multibyte Unicode characters literally (default is to escape as \\uXXXX).
- &gt;=5.3.3 Option JSON\_NUMERIC\_CHECK let you encode numeric strings as numbers.

Usage
=====

[](#usage)

```
$data = array('foo' => 'bar');
echo Future\Json::encode($data, JSON_PRETTY_PRINT);
echo Future\Json::encode($data, JSON_NUMERIC_CHECK);
echo Future\Json::encode($data, JSON_UNESCAPED_SLASHES);
echo Future\Json::encode($data, JSON_UNESCAPED_UNICODE);
echo Future\Json::encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
echo Future\Json::encode($data, null, 4);
```

Shortcut
========

[](#shortcut)

If you dont like Namespace\\Classname::staticMethod call, you can use shortcuts.

```
future_json_encode($data, JSON_UNESCAPED_UNICODE, 10);
```

Testing
=======

[](#testing)

If current version PHP allow to use features described above, then encoder will pass all arguments to native function instead.

Directory `tests/` contains json files that were generated using native function in PHP 5.5.6.

You can run the unit tests just to be sure that you will get exactly the same result regardless of your system:

```
$ composer install --dev
$ vendor/bin/phpunit tests/
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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

4176d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3239892?v=4)[Igor Denisenko](/maintainers/im-denisenko)[@im-denisenko](https://github.com/im-denisenko)

---

Top Contributors

[![im-denisenko](https://avatars.githubusercontent.com/u/3239892?v=4)](https://github.com/im-denisenko "im-denisenko (15 commits)")

---

Tags

jsonjson\_encode

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/im-denisenko-php-json-encode/health.svg)

```
[![Health](https://phpackages.com/badges/im-denisenko-php-json-encode/health.svg)](https://phpackages.com/packages/im-denisenko-php-json-encode)
```

###  Alternatives

[justinrainbow/json-schema

A library to validate a json schema.

3.6k334.7M787](/packages/justinrainbow-json-schema)[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k504.8M167](/packages/mtdowling-jmespathphp)[jms/serializer

Library for (de-)serializing data of any complexity; supports XML, and JSON.

2.3k141.9M929](/packages/jms-serializer)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k92.4M680](/packages/jms-serializer-bundle)[colinodell/json5

UTF-8 compatible JSON5 parser for PHP

30525.1M57](/packages/colinodell-json5)[clue/ndjson-react

Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.

15882.2M31](/packages/clue-ndjson-react)

PHPackages © 2026

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