Skip to content


Subversion checkout URL

You can clone with
Download ZIP


SERIALIZER_IGBINARY and objects containing multiple DateTime object instances #8

romainneutron opened this Issue · 2 comments

2 participants



I'm facing a weird issue : when I set an object containing more than one DateTime object property with the igbinary serializer option, the first datetime object is restored correctly, others are restored as incomplete PHP class

Here's a piece of code to reproduce the bug :

    class baba
            protected $date1;
            protected $date2;
            public function __construct()
                    $this->date1 = new DateTime('2011-04-07 13:17:09');
                    $this->date2 = new DateTime('2011-04-10 15:17:09');
                    return $this;
            public function print_datas()
                    echo $this->date1->format(DATE_ATOM)."\n";
                    echo $this->date2->format(DATE_ATOM)."\n";
                    return $this;
    $baba = new baba();
    $redis = new Redis();
    $redis->connect('', 6379);
    $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_IGBINARY);
    $redis->set("__baba__", $baba);
    $cached_datas = $redis->get("__baba__");

This bad behavior does not exists when I use the default PHP serializer.

This bad behavior does not exists when I use igbinary_serialize

I use igbinary 1.1.1 and phpredis 2.1.0.


Hello Romain,

Could you please check that it works with the pecl branch on github? Make sure to run ./configure --enable-redis-igbinary prior to compiling.
This branch will be merged into master soon.



Hello Nicolas,

I confirm you that the problem does not occur anymore in the pecl branch
For information, when will you merge this branch into master ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.