Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Json5 Laravel Package

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.

View on GitHub
Deep Wiki
Context7
v3.0.0

You should not notice any breaking changes in this release unless you were using named parameters, or ignoring argument types defined in docblocks.

Changed

  • Renamed function parameters to match json_decode()'s signature
    • $source is now $json
    • $options is now $flags
  • Added explicit mixed return type to match json_decode()
  • Added proper types to all parameters and return values of SyntaxError
  • Renamed two arguments in the SyntaxError's constructor:
    • $linenumber is now $lineNumber
    • $columnNumber is now $column

Removed

  • Removed support for PHP 7.x (8.0+ is now required)
v2.3.0

Added

  • Added parameter and return types matching the existing docblocks

Fixed

  • Fixed missing [@throws](https://github.com/throws) docblocks needed for PhpStorm to recognize exceptions (#21)
v2.2.2

Fixed

  • Fixed "small" integers always being cast to strings when JSON_BIGINT_AS_STRING is set (#17)
  • Fixed exceptions not being thrown when invalid UTF-16 escape sequences are encountered in strings
v2.2.1

Fixed

  • Fixed exceptions always being thrown on PHP 7.3+ when parsing valid JSON5 with JSON_THROW_ON_ERROR explicitly set to true (#15)
v2.2.0

Added

  • Added support for PHP 8.0

Removed

  • Removed support for PHP 5.6 and 7.0
v2.1.0

Added

  • Added .phpstorm.meta.php for better code completion
  • Added several tiny micro-optimizations

Removed

  • Removed support for PHP 5.4 and 5.5
v2.0.0

Now with 100% more PHP 7.3 compatibility!

Added

  • Added a polyfill for class \JsonException (added in PHP 7.3)
  • Added a polyfill for constant JSON_THROW_ON_ERROR

Changed

  • The SyntaxError class now extends from \JsonException
v1.0.5

Fixed

  • Fixed exceptions not being thrown for incomplete objects/arrays
v1.0.4

Changed

  • Modified the internal pointer and string manipulations to use bytes instead of characters for better performance (#4)
v1.0.3

Fixed

  • Fixed check for PHP 7+
v1.0.2

This release contains massive performance improvements of 98% or more, especially for larger JSON inputs!

Added

  • On PHP 7.x: parser will try using json_decode() first in case normal JSON is given, since this function is much faster (#1)

Fixed

  • Fixed multiple performance issues (#1)
  • Fixed bug where JSON_OBJECT_AS_ARRAY was improperly taking priority over assoc in some cases
v1.0.1

Removed

  • Removed accidentally-public constant
v1.0.0

Initial release! :tada:

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport