Skip to content

getVersion() returns wrong array key  #290

@ivpfals

Description

@ivpfals

Hi,
I'm using memcached 3.0.0b1 with libmemcached 1.0.16/Memcached 1.4.15 under PHP 7.0.14.
If you are calling the getVersion() method the array key returned for the first added server is wrong, it contains the wrong port number:

$MC = new Memcached;
$MC->addServer('localhost','11211');

$version = $MC->getVersion();
var_dump($version);

$stats = $MC->getStats();
var_dump($stats);

The var_dump($version) returns:

array(1) {
  ["localhost:11210"]=>
  string(6) "1.4.15"
}

while the var_dump($stats) returns:

array(1) {
  ["localhost:11211"]=>
  array(48) {
    ["pid"]=>
    int(10346)
    ["uptime"]=>
    int(3521)
    ["time"]=>
    int(1484048172)
    ["version"]=>
    string(6) "1.4.15"
    ["libevent"]=>
    string(13) "2.0.21-stable"
    ...
    ...
   

Seems that getVersion() cuts somehow the port number?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions