innmind / json
Type safe json encoder/decoder
1.4.0
2024-03-23 14:35 UTC
Requires
- php: ~8.2
- ext-json: *
- innmind/immutable: ~5.3
Requires (Dev)
- innmind/coding-standard: ~2.0
- phpunit/phpunit: ~10.0
- vimeo/psalm: ~5.23
This package is auto-updated.
Last update: 2024-11-23 15:58:21 UTC
README
Type safe json encode/decoder, the goal is to not leave errors unchecked.
Installation
composer require innmind/json
Usage
use Innmind\Json\Json; Json::encode(['foo' => 'bar']); // {"foo":"bar"} Json::decode('{"foo":"bar"}'); // ['foo' => 'bar'] Json::decode('{]'); // will throw an exception (instead of returning false)