'AWS Elastic Cache Cluster PHP client not working in resetServerList() function

I have an issue with Memcached, After resetServerList() function the object is not supported to next any activities like set, add, etc...

PHP version : 7.2 AWS Elastic cache cluster client: 3.1.3

After resetServerList() not working correctly

The sample code is mentioned below.

$m = new \Memcached($persistent_id);
$m->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
var_dump($m->addServer($host, $port, $weight));
echo "<br>server List: ";var_dump($m->getServerList());
echo "<br>Reset Server Status: ";var_dump($m->resetServerList());
echo "<br>Add Server Status: ";var_dump($m->addServer($host, $port, $weight));
echo "<br>Server List: ";var_dump($m->getServerList());

Results:

Reset Server Status: bool(true)
Add Server Status: **bool(false)**
Server List: **array(0) { }**

Kindly any solution for this.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source