colinodell/json5
PHP JSON5 parser/decoder. Adds json5_decode() as a drop-in replacement for json_decode(), supporting comments, trailing commas, single quotes, and more. Always throws SyntaxError on parse failure. Includes a json5 CLI to convert JSON5 to JSON.
You should not notice any breaking changes in this release unless you were using named parameters, or ignoring argument types defined in docblocks.
json_decode()'s signature
$source is now $json$options is now $flagsmixed return type to match json_decode()SyntaxErrorSyntaxError's constructor:
$linenumber is now $lineNumber$columnNumber is now $column[@throws](https://github.com/throws) docblocks needed for PhpStorm to recognize exceptions (#21)JSON_BIGINT_AS_STRING is set (#17)JSON_THROW_ON_ERROR explicitly set to true (#15).phpstorm.meta.php for better code completion\JsonException (added in PHP 7.3)JSON_THROW_ON_ERRORSyntaxError class now extends from \JsonExceptionThis release contains massive performance improvements of 98% or more, especially for larger JSON inputs!
json_decode() first in case normal JSON is given, since this function is much faster (#1)JSON_OBJECT_AS_ARRAY was improperly taking priority over assoc in some casesHow can I help you explore Laravel packages today?