Skip to content

Memcached::setMulti(): failed to set key on PHP 7 #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
oligriffiths opened this issue Jun 29, 2016 · 4 comments
Closed

Memcached::setMulti(): failed to set key on PHP 7 #260

oligriffiths opened this issue Jun 29, 2016 · 4 comments
Labels

Comments

@oligriffiths
Copy link

oligriffiths commented Jun 29, 2016

Hi

On PHP 7 I'm getting the following error:

Memcached::setMulti(): failed to set key

$memcached = new Memcached('mcrouter_pool');
$memcached->addServers([['127.0.0.1', 11211]]);
$memcached->setMulti(['foo' => 'bar'], 500);

However on PHP 5 I get no error. Has the behavior changed that it raises an E_WARNING in PHP 7?

Is this a known issue?

Thanks

@laruence
Copy link
Contributor

I think this should be fixed, could you please try with the newest snapshot?

@oligriffiths
Copy link
Author

I'll give it a try. Thanks

@oligriffiths
Copy link
Author

oligriffiths commented Sep 16, 2016

Hi @laruence it doesn't seem fixed:

<?php
error_reporting(E_ALL);
ini_set('display_errors','On');

$memcached = new Memcached('mcrouter_pool');
$memcached->addServers([['127.0.0.1', 11211]]);
var_dump($memcached->setMulti(['foo' => 'bar'], time() + 500));

php 5:

php test.php
bool(false)

php7:

php test.php
Warning: Memcached::setMulti(): failed to set key foo in /home/oli/test.php on line 7
bool(false)

@oligriffiths
Copy link
Author

On second look, it seems fine now. Thanks

Krinkle added a commit to Krinkle/php-memcached that referenced this issue Aug 18, 2021
This was introduced in 6837d89494,
pull php-memcached-dev#214. I suspect it
may have been a left-over from debugging something. The test was later
changed in 6837d89 to expect the warning in question, although other
similar tests don't encounter such warning currently.

It appears no other Memcached methods emit a PHP Warning when they encounter
a write read or failure. Instead, they typically turn their return value
into boolean false, and provide details via getResultMessage().

The introduction of this warning since php-memcached 3.0 has led to a number
of confused consumers (locally php-memcached-dev#260, php-memcached-dev#409, php-memcached-dev#450, and more reports
within downstream issue trackers).

Closes php-memcached-dev#409.
Krinkle added a commit to Krinkle/php-memcached that referenced this issue Aug 18, 2021
This was introduced in 6837d89494,
pull php-memcached-dev#214. I suspect it
may have been a left-over from debugging something. The test was later
changed in 6837d89 to expect the warning in question, although other
similar tests don't encounter such warning currently.

It appears no other Memcached methods emit a PHP Warning when they encounter
a write read or failure. Instead, they typically turn their return value
into boolean false, and provide details via getResultMessage().

The introduction of this warning since php-memcached 3.0 has led to a number
of confused consumers (locally php-memcached-dev#260, php-memcached-dev#409, php-memcached-dev#450, and more reports
within downstream issue trackers).

Closes php-memcached-dev#409.
Krinkle added a commit to Krinkle/php-memcached that referenced this issue Aug 18, 2021
This was introduced in 6837d89494,
pull php-memcached-dev#214. I suspect it
may have been a left-over from debugging something. The test was later
changed in 6837d89 to expect the warning in question, although other
similar tests don't encounter such warning currently.

It appears no other Memcached methods emit a PHP Warning when they encounter
a write read or failure. Instead, they typically turn their return value
into boolean false, and provide details via getResultMessage().

The introduction of this warning since php-memcached 3.0 has led to a number
of confused consumers (locally php-memcached-dev#260, php-memcached-dev#409, php-memcached-dev#450, and more reports
within downstream issue trackers).

Closes php-memcached-dev#409.
Krinkle added a commit to Krinkle/php-memcached that referenced this issue Aug 18, 2021
This was introduced in php-memcached-dev@6837d89494,
pull php-memcached-dev#214. I suspect it
may have been a left-over from debugging something. The test was later
changed in 6837d89 to expect the warning in question, although other
similar tests don't encounter such warning currently.

It appears no other Memcached methods emit a PHP Warning when they encounter
a write read or failure. Instead, they typically turn their return value
into boolean false, and provide details via getResultMessage().

The introduction of this warning since php-memcached 3.0 has led to a number
of confused consumers (locally php-memcached-dev#260, php-memcached-dev#409, php-memcached-dev#450, and more reports
within downstream issue trackers).

Closes php-memcached-dev#409.
sodabrew pushed a commit that referenced this issue Aug 23, 2021
This was introduced in 6837d89494,
pull #214. I suspect it
may have been a left-over from debugging something. The test was later
changed in 6837d89 to expect the warning in question, although other
similar tests don't encounter such warning currently.

It appears no other Memcached methods emit a PHP Warning when they encounter
a write read or failure. Instead, they typically turn their return value
into boolean false, and provide details via getResultMessage().

The introduction of this warning since php-memcached 3.0 has led to a number
of confused consumers (locally #260, #409, #450, and more reports
within downstream issue trackers).

Closes #409.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants