This is to do json_decode operation only on valid json string and in a highly performing way.
Inspired from discussion that I came across on a stackoverflow thread, specifically posts by
- Cyril (https://stackoverflow.com/a/43244302/7924752)
- Philipp (https://stackoverflow.com/a/45241792/7924752)
and implemented this library, to check if an input is a valid JSON string and likewise to also provide the json decoded content (array or object), as per choice, and when using specific methods for the purpose. More example inputs are considered, to make the implementation more robust while offer good performance. Benchmarks are yet to be made.
With Composer, run
composer require easeappphp/json-decode :^1.0.3
This software is distributed under the MIT license. Please read LICENSE for information on the software availability and distribution.