PHP 8.4.0 RC4 available for testing

Memcached::getVersion

(PECL memcached >= 0.1.5)

Memcached::getVersionGet server pool version info

Beschreibung

public Memcached::getVersion(): array|false

Memcached::getVersion() returns an array containing the version info for all available memcache servers.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

Array of server versions, one entry per server.

Beispiele

Beispiel #1 Memcached::getVersion() example

<?php
$m
= new Memcached();
$m->addServer('localhost', 11211);

print_r($m->getVersion());
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

Array
(
    [localhost:11211] => 1.2.6
)

add a note

User Contributed Notes 1 note

up
10
Mads Madsen
11 years ago
Was going mad, I figured getStatus() would return false on servers not responding. This is however not true, it will return:
array(1) {
["127.0.0.1:11112"]=>
string(11) "255.255.255"
}
On a failed connection.
To Top