json5

UTF-8 compatible JSON5 parser for PHP

MIT License

Downloads
11.7M
Stars
271
Committers
6
json5 - v3.0.0 Latest Release

Published by colinodell 9 months ago

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)
json5 - v2.3.0

Published by colinodell almost 2 years ago

Added

  • Added parameter and return types matching the existing docblocks

Fixed

  • Fixed missing @throws docblocks needed for PhpStorm to recognize exceptions (#21)
json5 - v2.2.2

Published by colinodell over 2 years ago

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
json5 - v2.2.1

Published by colinodell almost 3 years ago

Fixed

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

Published by colinodell almost 4 years ago

Added

  • Added support for PHP 8.0

Removed

  • Removed support for PHP 5.6 and 7.0
json5 - v2.1.0

Published by colinodell over 5 years ago

Added

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

Removed

  • Removed support for PHP 5.4 and 5.5
json5 - v2.0.0

Published by colinodell about 6 years ago

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
json5 - v1.0.5

Published by colinodell about 6 years ago

Fixed

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

Published by colinodell almost 7 years ago

Changed

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

Published by colinodell almost 7 years ago

Fixed

  • Fixed check for PHP 7+
json5 - v1.0.2

Published by colinodell almost 7 years ago

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
json5 - v1.0.1

Published by colinodell almost 7 years ago

Removed

  • Removed accidentally-public constant
json5 - v1.0.0

Published by colinodell almost 7 years ago

Initial release! 🎉

Package Rankings
Top 1.38% on Packagist.org
Badges
Extracted from project README
Latest Version on Packagist PHP 8.0+ Software License Build Status Coverage Status SensioLabs Insight Total Downloads