Skip to content
the fastest serialize function bound for php7
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests update tests Apr 16, 2019
.gitignore update Apr 16, 2019
LICENSE
README.md
bench.php No commit message Oct 22, 2016
config.m4 update Apr 16, 2019
package.xml
php_swoole_serialize.h fix Jun 3, 2019
swoole_serialize.c Merge remote-tracking branch 'origin/master' Jun 14, 2019
swoole_serialize.h

README.md

swoole_serialize

tips

the PHP kernel changes frequently which lead that the serialize module is too expensive to maintain, so temporarily give up support for more than PHP7.3.

require

  • PHP 7+

install

pecl install swoole_serialize 

or

phpize
./configure
make
make install
echo "extension=/path/to/swoole_serialize.so" >> php.ini

features

  • the fastest serialize function for php7 (see bench.php,or you can bench it use you data,trust me it is cool!).
  • support pack and fastPack two function.
  • support __sleep __wakeup __autoload etc.

use

$str = swoole_pack($arr);
$arr = swoole_unpack($str);


$str = swoole_fast_pack($arr);
$arr = swoole_unpack($str);

or

$str = swSerialize::pack($arr);
$arr = swSerialize::unpack($str);


$str = swSerialize::fastPack($arr);
$arr = swSerialize::unpack($str);

or

$o = new swSerialize();
$str = $o->pack($arr);
$o->unpack($str);


$o = new swSerialize();
$str = $o->fastPack($arr);
$o->unpack($str);

contact us

License

Apache License Version 2.0 see http://www.apache.org/licenses/LICENSE-2.0.html

You can’t perform that action at this time.