Skip to content

zRange and zRevRange has inconsistent parameters #1555

@RobbieLePommie

Description

@RobbieLePommie

Expected behaviour

zRange and zRevRange should accept an array of options ['WITHSCORES' => true] as the fourth parameter, and not the boolean.

Reasons:

  • is consistent with REDIS itself
  • is consistent with zRangeByScore
  • is consistent with the readme where there is an Freudian slip in the documentation (section zRemRangeByRank ) where it refers to $redis->zRange('key', 0, -1, ['withscores' => TRUE]); /* ['three' => 3] */

Actual behaviour

It accepts a boolean (true/false), not array.

I'm seeing this behaviour on

Master and Developer branch. PHP 7.1 - PHP 7.3

I've checked

  • There is no similar issue from other users
  • Issue isn't fixed in develop branch

Other Notes

As a breaking change, I would suggest accepting both as a deprecation path. Currently prevents easy adoption of the library.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions