markup/json
最新稳定版本:0.1.3
Composer 安装命令:
composer require markup/json
包简介
Json wrapper to provide a more robust Api (matching 7.3 where possible)
README 文档
README
Json wrapper to provide a more robust API matching PHP 7.3 with exceptions rather than errors.
The following json options are always used
- JSON_UNESCAPED_UNICODE
- JSON_BIGINT_AS_STRING
- JSON_THROW_ON_ERROR
Usage
try { $json = '{"a":1}'; $data = Encoder::decode($json); $json = Encoder::encode($data); } catch (\JsonException $exception) { echo $exception->getMessage(); // echoes "Syntax error" }
Reference
- https://wiki.php.net/rfc/json_throw_on_error
- https://ayesh.me/Upgrade-PHP-7.3#json-exceptions
- https://github.com/php/php-src/blob/master/ext/json/json.c#L257
Similar Packages
统计信息
- 总下载量: 29.47k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-06-13