Sitelet https://github.com/phpredis/phpredis/issues/2291
Skip to content

zRange now only accepts a string value in $start and $end #2291

Description

@RobiNN1

Expected behaviour

This should work $redis->zRange('zset', 0, -1);

According to the docs it should be possible to use both string and int. Aslo it works fine in v5.3.7.

phpredis/redis.stub.php

Lines 4110 to 4113 in 8cb6dd1

* @example $redis->zRange('zset', 0, -1);
* @example $redis->zRange('zset', '-inf', 'inf', ['byscore' => true]);
*/
public function zRange(string $key, mixed $start, mixed $end, array|bool|null $options = null): Redis|array|false;

Actual behaviour

Fatal error: Uncaught TypeError: Redis::zRange(): Argument # 2 ($start) must be of type string, int given.

I'm seeing this behaviour on

  • OS: Windows 11 Pro
  • Redis: 5.0.14.1
  • PHP: 8.2.0
  • phpredis: 6.0.0-dev (compiled for Windows from the latest commit 8cb6dd1 )

Steps to reproduce, backtrace or example script

$redis->zAdd('zet', 0, 'test');

var_dump($redis->zRange('zset', 0, -1));

I've checked

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions