- Added
string.utf8option which causes the string encoder to escape all valid multibyte UTF-8 characters using the PHP7 unicode code point syntax. - Added
string.binaryoption which causes the string encoder to encode all non UTF-8 strings using abase64_encode(). - Added
integer.typeoption that accepts valuesbinary,octal,decimalorhexadecimalwhich can be used to change the output syntax of integers. - Added
hex.capitalizeoption that causes all hexadecimal character in output to appear in upper case - Added
float.exportoption that forces float encoder to usevar_exportfor encoding floating point numbers - Float encoder now delegates integer encoding to the integer encoder (to allow different integer types).
- Increase the minimum PHP version requirement to 5.6
- Update to latest coding standards
- Update tests to work with PHPUnit 6
- Update travis build to test for PHP 7.1
- Ensure the tests run on both HHVM and PHP7
- The GMP encoder no longer tries to encode classes that extend the GMP class
- Fixed object encoder not throwing an exception on some incorrect object.format values
- Fixed coding standards issues around the code and api documentation
- Improved Travis build process
- Encoder options with
nulldefault value will now be recognized - The integer encoder will now add an
(int)cast in front of integers, if their value equalsPHP_INT_MAX * -1 - 1. - If
float.integersis set totrue, the float encoder will now only encode floats as integers if the value is accurately represented by the float. Set the value to"all"to restore the previous behavior. - The float encoder no longer breaks if the PHP locale uses comma as a decimal separator.
- The float encoder now behaves slightly differently when deciding whether to use the exponential float notation or not.
- The float encoder now uses
serialize_precisionwhen the optionprecisionis set tofalse - Several methods will now throw an InvalidOptionException if any invalid encoder options have been provided
array.alignwill now respectarray.omitandarray.inlinesettings if all the keys in the array can be omitted.- Clarified documentation on how these settings are intended to work together.
- Improvements on code quality, documentation and tests
- Encoding is now separated into external encoding classes
- Various options are now set via PHPEncoder::setOption() instead
- GMP encoding now supports PHP 5.6.0 and later
- Encoder now detects and throws an exception on recursion
- Null and boolean capitalization can now be customized
- It's possible to choose from long or short array notation
- Encoder now supports inlining simple arrays
- The end of line character for arrays can now be modified
- Added new object conversion flags OBJECT_VARS and OBJECT_SET_STATE.
- The default object conversion is now OBJECT_VARS | OBJECT_CAST
- Documentation now acknowledges the existence of var_export
- GMP Integer resources are now encoded using 'gmp_init()'
- The library now correctly disables align keys when whitespace is disabled
- Code cleanup and documentation fixes