0

I have next setup:

  • PHP 8.1
  • Redis 7.0.11 - latest version
  • phpredis 5.3.7 - latest version

When I try to instantiate Redis class like this:

$redis = new Redis([
    'host' => '127.0.0.1',
    'port' => 6379,
    'connectTimeout' => 2.5,
    'auth' => 'password',
    'ssl' => ['verify_peer' => false],
    'backoff' => [
        'algorithm' => Redis::BACKOFF_ALGORITHM_DECORRELATED_JITTER,
        'base' => 500,
        'cap' => 750
    ]
]);

I get the next error:

Fatal error: Uncaught ArgumentCountError: Redis::__construct() expects exactly 0 arguments, 1 given...

Looks like constructor does not accept any arguments, but according to documentation it should.

When I try to instantiate class without config options passed, everything works as expected.

I've googled but could not find any mentioning of this error on the web, please help!

Acidon
  • 1,294
  • 4
  • 23
  • 44
  • From that page you linked: "_Starting from version 6.0.0 it's possible to specify configuration options._" – brombeer Apr 19 '23 at 18:39
  • @brombeer I thought it refers to Redis version, 5.3.7 is the latest and in a 2 week old issues thread they state that "Documentation describes current development version" - https://github.com/phpredis/phpredis/issues/2341#issuecomment-1501049379 . – Acidon Apr 19 '23 at 18:44
  • 1
    `5.3.7.` is the latest _stable_ version/release. `develop` should be ahead of `stable` with features not yet released – brombeer Apr 19 '23 at 18:46
  • @brombeer got it, still learning this github stuff. I was looking for a v 6.0.0. branch and didn't find one so assumed the 6.0.0. was referring to Redis. – Acidon Apr 19 '23 at 18:51

0 Answers0