Upgrading
Upgrading to Version 4.0
Neon::decode(), decodeFile() and encode() work as before and give the same values. What
changed:
- the minimum required PHP version is 8.4, and the
mbstringextension is required - the syntax tree is new:
Neon::parse()gives a losslessDocumentNodeyou can edit; the classesNette\Neon\DecoderandNette\Neon\Node\*and the oldTraverserare gone, the nodes are now inNette\Neon\Nodes, and a node cannot be serialized encode()throwsNette\Neon\Exceptionfor a string that is not valid UTF-8, where 3.4 replaced the invalid bytes and triggered a warning, and for a resource, a closure or a structure that contains itself- the constants
Neon::BLOCKandNeon::CHAINtriggerE_USER_DEPRECATED; passtrueas the second argument ofencode()and useNeon::Chain decode()accepts a byte order mark at the start of the input, asdecodeFile()does- some error messages are more precise, so code that matches their text may need a change
neon-lintno longer has the option--debug, and it has new options
Since version 4.0.1, a value on the line after a key inside brackets is the value of that key, as in JSON: {a: and
b} on the next line is {a: b}. Version 3 read it as {a: null, 0: b}. Decoding such a
document triggers E_USER_NOTICE; to keep the old meaning, write null or a comma after the key.
Upgrading to Version 3.4
- the
\xAAescape sequence was removed, useꪪinstead - the
onandoffkeywords are no longer decoded as booleans, usetrue/yesandfalse/no
Upgrading to Version 3.2
- the Decoder works in UTF-8 mode and throws an exception on invalid input
- the
\xAAescape sequence is deprecated in favor ofꪪ