Skip to content

JsonReader 0.7.0

Compare
Choose a tag to compare
@pcrov pcrov released this 05 Mar 15:12
· 32 commits to master since this release
9194f17

This release features an overhaul in lexing as well as other performance improvements. Things should be a bit faster.

Numbers will no longer be returned as strings from JsonReader::value(), they will instead be cast automatically to float or int as appropriate while minding the new option below.

Added

  • JsonReader::FLOATS_AS_STRINGS option is now accepted by the JsonReader constructor. This will cause the reader to return floats as their original strings. This includes any JSON number with a decimal point or exponent, as well as those above PHP_INT_MAX or below PHP_INT_MIN.

Changed

  • The JsonReader node constants are now strings. This makes debugging a bit easier. Note that this also changes the return type of JsonReader::type() to string.
  • The parser, lexer, and input streams are no longer Traversable. Those using these directly will want to check their new simplified interfaces.
  • Tuples from the lexer have a new shape to them. Again if you're using this directly you'll want to check the new interface.