igbinary pecl.php.net igbinary extension Igbinary is a drop in replacement for the standard php serializer. Instead of the time and space consuming textual representation used by PHP's serialize(), igbinary stores php data structures in a compact binary form. Savings are significant when using memcached or similar memory based storages for serialized data. Oleg Grenrus phadej oleg.grenrus@iki.fi yes Pierre Joye pajoye pierre@php.net yes Teddy Grenman tricky teddy.pecl@luuseri.com yes Tyson Andre tandre tandre@php.net yes 2025-11-26 3.2.17RC1 1.4.0 stable stable BSD-3-Clause * Support PHP 8.5 * Fix some Windows builds * Remove php_smart_string.h usage 7.0.0 1.4.0b1 igbinary 2024-08-10 3.2.16 1.4.0 stable stable BSD-3-Clause * Fix test failures in php 8.4.0alpha1 due to tests calling deprecated functions (#390) 2023-12-02 3.2.15 1.4.0 stable stable BSD-3-Clause * Fix crash in igbinary_unserialize_object_enum_case with opcache protected memory and non-constant value. 2023-02-26 3.2.14 1.4.0 stable stable BSD-3-Clause * Fix build error in PHP 8.3-dev * Fix test expectation errors in php 8.3-dev due to change to php's TypeErrors. 2023-02-02 3.2.13 1.4.0 stable stable BSD-3-Clause * Speed up unserialization of typed properties by reducing hash table collisions when looking up property reference info. 2022-11-07 3.2.12 1.4.0 stable stable BSD-3-Clause * Fix symbol error seen in php 8.2.0 loading zend_class_unserialize_deny, due to failing to load a header defining a macro. 2022-11-06 3.2.11 1.4.0 stable stable BSD-3-Clause * Fix a bug that could prevent objects/arrays with reference cycles from being properly garbage collected. * Fix bugs in unserializing PHP references to values found in php 7.4 typed properties (#363) 2022-11-06 3.2.10 1.4.0 stable stable BSD-3-Clause * Add a macro that callers can use to check if igbinary will accept the header for data being unserialized. * Fix bug preventing the unserialization of data containing representations of strings larger than 4GB. 2022-10-17 3.2.9 1.3.1 stable stable BSD-3-Clause * Fix invalid release artifact name in job to build dlls for https://github.com/igbinary/igbinary 2022-10-16 3.2.8 1.3.1 stable stable BSD-3-Clause * Reduce excessive inlining to reduce shared library size. * Miscellaneous optimizations. * Update test expectations to handle changes to var_export output (fully qualified class names) in PHP 8.2. * Throw an Error when igbinary_unserialize would add dynamic properties to class definitions that forbid them in PHP 8.0+ (especially PHP 8.2 `readonly` classes) * Emit a deprecation notice when igbinary_unserialize() adds dynamic properties to a class without `#[AllowDynamicProperties]` in PHP 8.2. Doing that would become an Error in PHP 9.0. * Set up CI job to build dlls on https://github.com/igbinary/igbinary - at the moment, the infrastructure used by the Windows for php team has been broken for months. 2021-08-11 3.2.7 1.3.1 stable stable BSD-3-Clause * Update test expectations for php 8.2.0-dev. Add `#[AllowDynamicProperties]` Attribute to some tests to avoid notices. * In php 8.1+, make igbinary_unserialize check to see if an equivalent interned string already exists when unserializing object property names, array keys, and class names and use that instead of creating a brand new string. (This deliberately doesn't create a new interned string if one doesn't already exist.) (Before this change, igbinary would deduplicate strings when serializing, but would not check if strings were interned by PHP itself when unserializing) * Avoid debug build assertion failure for `HT_ASSERT_RC1` the same way as PHP's unserialize - this is a case where ostensibly there are no other references to the array being unserialized. 2021-08-11 3.2.6 1.3.1 stable stable BSD-3-Clause * Fix igbinary extension version found in reflection. 2021-08-07 3.2.5 1.3.1 stable stable BSD-3-Clause * Fix change in behavior introduced in 3.2.2RC1 when unserializing arrays - the internal array pointer (for `next()`, `key()`, etc) pointed past the end of the array in php 7.0-7.2. 2021-07-24 3.2.4 1.3.1 stable stable BSD-3-Clause * Forbid serializing classes that deny serialization/unserialization (anonymous classes, CURLFile, etc.) even when subclasses implement '__serialize' and '__unserialize' 2021-06-09 3.2.3 1.3.1 stable stable BSD-3-Clause * Fix build for php 8.1 after changes to enum internals. * Update tests to suppress deprecations in php 8.1 and support run-tests.php changes in php 8.1 * Don't emit a notice when unserialize_callback_func causes igbinary_unserialize to throw https://bugs.php.net/bug.php?id=81118 2021-04-18 3.2.2 1.3.0 stable stable BSD-3-Clause * Eliminate impossible/redundant checks. * Add a new type code for serialization and unserialization of PHP strings that are larger than 4GB. * Add additional checks for overflow when serializing extremely large data structures. (e.g. serializing more than 2**32 strings or 2**32 objects/references/arrays) * Support serializing and unserializing php 8.1 enums (can only be unserialized in php 8.1+) 2021-01-11 3.2.2RC1 1.2.5 beta stable BSD-3-Clause * Update php version check to allow igbinary to be statically built in PHP 8.0+ * Fix bug in out of memory error handling in __sleep, slightly speed up serializing with __sleep. * Continue serializing remaining properties if a missing property name is returned from __sleep. * Speed up serializing by optimizing for the case where there is no memory manager override. When there is a memory manager override, only use that for allocating the string to return. (benchmarks/serialize-scalar-int.b.php showed a speedup from 0.22 to 0.18 seconds for repeated serialization of a single scalar, and from 0.186 to 0.180 seconds for benchmarks/serialize-stringarray.b.php for an array of strings) * Speed up unserializing arrays in php 7.2-8.0 by adding optimized code for finding the hash bucket of a string/integer key of an array, or creating a placeholder if it does not already exist. 2020-12-27 3.2.1 1.2.5 stable stable BSD-3-Clause * Fix crash when unserializing if __serialize was defined but __unserialize was undefined in php 8.0+ (due to typo). 2020-12-26 3.2.0 1.2.5 stable stable BSD-3-Clause * Use PHP's shared empty array instance when unserializing empty arrays in php 7.3+. (helps slightly with memory usage when repeatedly unserializing, when removing elements from arrays before unserializing them, or when serializing values including an empty array that was unserialized) * Emit a deprecation notice when serializing resources. PHP itself is converting many resources to objects that throw an Error on serialization attempts. Continue to represent resources as null in the serialized data. * Fix memory management bug when unserializing invalid data (duplicate properties in objects (e.g. from `__sleep`) or duplicate fields in arrays (impossible for valid data)). * Speed up calls to `__serialize`/`__unserialize` in php 8.0+. * Fix error messages for unserialize_callback_func: make messages properly refer to the autoload function. * Optimize unserializing alternative names for private/protected properties that were previously public. 2020-10-08 3.1.6 1.2.4 stable stable BSD-3-Clause * Fix build failure with older C standard (e.g. building on CentOS 6). * Otherwise, identical to 3.1.6RC1. 2020-10-07 3.1.6RC1 1.2.4 beta stable BSD-3-Clause * Fix igbinary_serialize incorrectly deduplicating arrays/objects/references when they were garbage collected/freed during serialization. 2020-09-02 3.1.5 1.2.3 stable stable BSD-3-Clause * Update unit test expectation to match behavior in php 8 due to changes in php's handling of cyclic references in arrays. * Support API changes in php 8.0.0beta3. 2020-08-05 3.1.4 1.2.3 stable stable BSD-3-Clause * Fix unserialization of PHP references to internal/user-defined classes using PHP 7.4's `__unserialize` (e.g. `ArrayObject`) 2020-08-04 3.1.3 1.2.3 stable stable BSD-3-Clause * Properly serialize reference groups of size 1 (these can be created by array_walk_recursive and other functions). Note that this does not fix the general case where values not being serialized are in the same reference group as a value being serialized. * PHP 8.0 compatibility fixes. 2020-01-21 3.1.2 1.2.3 stable stable BSD-3-Clause * Speed up object, array, reference, and string serialization. * Speed up unserializing integers between 0 and 65535 (as values and array keys). * Speed up unserializing objects with declared properties. 2020-01-16 3.1.1 1.2.3 stable stable BSD-3-Clause * Fix bug causing incorrect serialization for 1 in 2**32 strings on 64-bit php installations when string hashes collide. (https://github.com/igbinary/igbinary/issues/260) 2021-01-11 3.1.1a1 1.2.2 beta beta BSD-3-Clause * Throw when an uninitialized php 7.4 typed property is included in the result of __sleep(), instead of emitting a notice and attempting to represent the unset/uninitialized value as null (#258). See https://bugs.php.net/bug.php?id=79002 Uninitialized properties without types (from __sleep) continue to cause igbinary to emit notices and are represented as null. 2019-12-27 3.1.0 1.2.2 beta beta BSD-3-Clause * Same as 3.1.0b4. 2019-12-20 3.1.0b4 1.2.2 beta beta BSD-3-Clause * Don't call __destruct for objects where deferred __unserialize calls were not started (e.g. due to Serializable::unserialize throwing). 2019-12-10 3.1.0b3 1.2.2 beta beta BSD-3-Clause * Skip over object properties that are uninitialized or unset when serializing, instead of serializing them as null. This is done to avoid Errors when unserializing their values for php 7.4 typed properties. 2019-12-09 3.1.0b2 1.2.1 beta beta BSD-3-Clause * Fix crashes related to unserializing instances of classes with php 7.4 typed properties. 2019-12-08 3.1.0b1 1.2.1 beta beta BSD-3-Clause * Support php 7.4's __serialize/__unserialize the same way serialize()/unserialize() does. This deliberately only supports __serialize/__unserialize in php 7.4, to making switching to/from serialize()/unserialize() as straightforward as possible. 2019-03-20 3.0.1 1.2.0 stable stable BSD-3-Clause * Fix version check when statically building igbinary inside of the php-src folder. 2019-02-17 3.0.0 1.2.0 stable stable BSD-3-Clause * Identical to 3.0.0a2 2019-02-13 3.0.0a2 1.2.0 alpha stable BSD-3-Clause * Don't use empty string for serializing empty $_SESSION array, it breaks some save handlers. (Issue #231) Continue treating the empty string as the empty $_SESSION array when unserializing. 2019-02-09 3.0.0a1 1.2.0 alpha stable BSD-3-Clause * Drop support for PHP 5. * Drop support for APC (APC was only available for PHP5 - It is the predecessor of APCu) * Emit a warning and return null if igbinary_unserialize() is passed more data to unserialize than expected. * Fix compilation against PHP 7.4-dev. Igbinary does NOT yet properly serialize/unserialize all classes with PHP 7.4-dev's typed properties. * The serialization format is exactly the same as igbinary 2.x 2018-10-20 2.0.8 1.1.2 stable stable BSD-3-Clause * Be more aggressive about deduplication when generating serialization of arrays in php 7.0+. * Define HAVE_IGBINARY on Unix/Linux. (previously defined only on Windows) * Update formatting/wording of documentation. 2018-06-27 2.0.7 1.1.1 stable stable BSD-3-Clause * Fix compiler warnings about format strings, for errors that should not occur during normal igbinary usage. 2018-05-12 2.0.6 1.1.1 beta stable BSD-3-Clause * Same as 2.0.6RC1 2018-04-01 2.0.6RC1 1.1.1 stable stable BSD-3-Clause * Same as 2.0.6RC1 * Fix a bug in Windows debug builds. * Emit more specific warnings when __sleep() returns a declared property that was unset. * Fix harmless compiler warnings during builds. * Fix a build error on PHP7.3-dev. 2017-11-04 2.0.5 1.1.1 stable stable BSD-3-Clause * Same as 2.0.5RC1 (no bugs were reported in that release candidate) 2017-10-15 2.0.5RC1 1.1.1 beta stable BSD-3-Clause * Improve performance when unserializing objects/arrays and serializing objects/arrays/strings in php 5/7. * Update unserialization of integer object keys for php 7.2: Make those keys accessible when unserializing. * Properly pick up presence of gcc for default compiler flags (`cc --version` doesn't contain gcc). Add -O2 to default gcc compiler flags. * Use empty string for serializing empty $_SESSION array, similar to "session.serialize_handler=php". Older igbinary releases already unserialize the empty string to the empty array. 2017-04-14 2.0.4 1.1.1 stable stable BSD-3-Clause * Fixes bug #129: Should not call __wakeup() on data which was created by Serializable::unserialize() 2017-03-31 2.0.3 1.1.1 stable stable BSD-3-Clause - Fixes bug #126: Fatal error: "igbinary_serialize_zval: zval has unknown type 0" (IS_UNDEF) Make this a warning instead of a fatal error (and serialize as null instead), since IS_UNDEF is a known type. Later releases will fix the root cause of the warning, and consistently omit array/object/other entries for IS_UNDEF. 2017-02-28 2.0.2 1.1.1 stable stable BSD-3-Clause - Compatible with PHP 5.2 - 7.1 - Fixes crash in Memcached->setMulti (in php 7.0+) when the first level of array elements have references as values. Other extensions using igbinary shouldn't be affected. 2016-11-19 2.0.1 1.1.1 stable stable BSD-3-Clause - Compatible with PHP 5.2 - 7.0 - Fixes bug in session decoder not calling wakeup in php 7.0+ - (Enhancement) Reuses identical strings when unserializing objects and arrays in php 7.0+ 2016-10-30 2.0.0 1.1.1 stable stable BSD-3-Clause - Compatible with PHP 5.2 - 7.0 (Adds PHP 7 support) - Serialization format is unchanged - Performance improvements for serialization and unserialization in PHP 5.2 - 7.0 - (PHP 7) Don't call __destruct if __wakeup threw an exception (or __wakeup wasn't called yet) - Ports integration with other extensions to PHP 7.0 (session serialization, Memcached, Redis, APCu, etc.) - Fixes Windows PECL builds for PHP 5.6+ - Reword warnings for invalid header bytes of serialized data (in igbinary_unserialize). 2014-08-29 1.2.1 1.1.1 stable stable BSD-3-Clause-3-Clause - Compatible with PHP 5.2 - 5.6 2014-08-29 1.2.0 1.1.1 stable stable BSD-3-Clause - PECL bug #22614, igbinary_unserialize(FALSE) must return FALSE - PHP bug #54662, unserializing nested objects cause crash - Other fixes 2011-03-14 1.1.1 1.1.1 stable stable BSD-3-Clause - Initial PECL release 2009-09-02 1.0.2 1.0.2 stable stable PHP like license - Use Z_ADDREF_PP or Z_ADDREF et al. when increasing refcount.