php-src icon indicating copy to clipboard operation
php-src copied to clipboard

Uncaught TypeError: Memcached::setMulti(): Argument #2 ($expiration) must be of type int, int given

Open momala454 opened this issue 4 years ago • 2 comments

Description

The following code:

<?php declare(strict_types=1);
error_reporting(E_ALL);
ini_set('display_errors', true); 


$m = new Memcached();
$m->setMulti(['hello' => 'world'], 2);

Resulted in this output:

Fatal error: Uncaught TypeError: Memcached::setMulti(): Argument #2 ($expiration) must be of type int, int given

But I expected this output instead:

No error

PHP Version

8.1.2

Operating System

Debian 11.2

momala454 avatar Feb 04 '22 15:02 momala454

See https://github.com/php-memcached-dev/php-memcached/issues/496.

damianwadley avatar Feb 04 '22 15:02 damianwadley

I fixed the issue by updating memcahed, i run sudo apt install php8.1-memcached which updated my memcached to 3.2

SQ44 avatar Dec 02 '22 14:12 SQ44