Skip to content

Redis::OPT_SERIALIZER and EVAL #431

@rybakit

Description

@rybakit

I've noticed some unexpected behaviour when working with Redis::eval().
For me it looks a bit weird that I can do this:

$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
$redis->zAdd('key', 1, new stdClass());

but not this:

$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
$redis->eval('redis.call("ZADD", KEYS[1], ARGV[1], ARGV[2])', ['key', 1, new stdClass()], 1);

So guys what do you think about introducing a Redis::serialize() utility method or even serializing arguments automatically for the eval/evalSha?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions