php8.5
Home/ Manual/ memcached / memcached/ Memcached::getResultMessage

Memcached::getResultMessage

PHP function Edit on GitHub ✎

(PECL memcached >= 1.0.0)

Return the message describing the result of the last operation

Description

Memcached::getResultMessage(): string

Memcached::getResultMessage() returns a string that describes the result code of the last executed Memcached method.

Parameters Parameters

Return Values

Message describing the result of the last Memcached operation.

Examples

Memcached::getResultMessage() example

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

$m->add('foo', 'bar'); // first time should succeed
$m->add('foo', 'bar');
echo $m->getResultMessage(),"\n";
?>

The above example will output:

output
NOT STORED

Source: reference/memcached/memcached/getresultmessage.xml · from the official PHP manual (php/doc-en)