riimu/kit-phpencoder
Highly customizable alternative to var_export for PHP code generation
v2.4.2
8.5M downloads/mo
#1995 most downloaded on Packagist
Riimu/Kit-PHPEncoder
What this package is like to depend on
Last release 4 years ago
no release in 18 months
Release timing varies
gaps range from 1 weeks to 2.4 years
Most releases are documented
notes for 14 of 19 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
19 releases · first in 2013
0 releases in the last 12 months
see the full history below
Release timeline
19 releases · Nov 2013 to Dec 2022Releases
latest 19-
v2.4.210 Dec 2022Release notes
Open source →- Added tests to ensure PHP 8.2 compatibility
- Changed
exporttype object conversion have more consistent index order
Release notes
Open source →- Added tests to ensure PHP 8.2 compatibility
- Changed
exporttype object conversion have more consistent index order
- Changed
-
v2.4.129 Nov 2020Release notes
Open source →- Migrated to Github actions for CI
- Added automated builds to test for PHP versions from 5.6 to 8.0
Release notes
Open source →- Migrated to Github actions for CI
- Added automated builds to test for PHP versions from 5.6 to 8.0
-
v2.4.003 Jul 2018Release notes
Open source →- Added
string.classesoption, which allows to define an array of classes or
namespaces to encode using the::classformat, when encountered as strings - Added
string.importsoptions, which allows to define the used imports to write
the::classformat strings using shorter imported notation - Support for HHVM has been dropped, as HHVM no longer aims for PHP compatibility
- Added travis builds for PHP 7.2
- Change some rules in the used coding standard
Release notes
Open source →- Added
string.classesoption, which allows to define an array of classes or namespaces to encode using the::classformat, when encountered as strings- Added
string.importsoptions, which allows to define the used imports to write the::classformat strings using shorter imported notation - Support for HHVM has been dropped, as HHVM no longer aims for PHP compatibility
- Added travis builds for PHP 7.2
- Change some rules in the used coding standard
- Added
- Added
-
v2.3.015 Jul 2017Release notes
Open source →- 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,decimal
orhexadecimalwhich 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_export
for encoding floating point numbers - Float encoder now delegates integer encoding to the integer encoder (to
allow different integer types).
Release notes
Open source →- 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).
- Added
- Added
-
v2.2.008 Jul 2017Release notes
Open source →- 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
Release notes
Open source →- 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
-
v2.1.308 Nov 2015 -
v2.1.222 Aug 2015Release notes
Open source →- The GMP encoder no longer tries to encode classes that extend the GMP class
Release notes
Open source →- The GMP encoder no longer tries to encode classes that extend the GMP class
-
v2.1.108 Aug 2015Release notes
Open source →- 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
Release notes
Open source →- 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
- Fixed object encoder not throwing an exception on some incorrect
-
v2.1.018 Apr 2015Release notes
Open source →- 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 optionprecision
is set tofalse - Several methods will now throw an InvalidOptionException if any invalid
encoder options have been provided
Release notes
Open source →- 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
- The integer encoder will now add an
- Encoder options with
-
v2.0.221 Jan 2015Release notes
Open source →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.
Release notes
Open source →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.
-
v2.0.111 Jan 2015 -
v2.0.029 Dec 2014Release notes
Open source →- 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
- Encoding is now separated into external encoding classes
-
v1.5.010 Jul 2014Release notes
Open source →- 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
- Added new object conversion flags OBJECT_VARS and OBJECT_SET_STATE.
-
v1.4.030 May 2014Release notes
Open source →- 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
- GMP Integer resources are now encoded using 'gmp_init()'
-
v1.3.105 May 2014Nothing published for this version
-
v1.3.005 Jan 2014Nothing published for this version
-
v1.2.009 Dec 2013Nothing published for this version
-
v1.1.001 Nov 2013Nothing published for this version
-
v1.0.001 Nov 2013Nothing published for this version