Skip to content

setmulti Error :: must be of type int, int given #1514

Closed
@davidteruelguillem

Description

@davidteruelguillem

If you copy the next example from https://www.php.net/manual/es/memcached.setmulti.php

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

$items = array(
    'key1' => 'value1',
    'key2' => 'value2',
    'key3' => 'value3'
);
$m->setMulti($items, time() + 300);

You will get the error "PHP Fatal error: Uncaught TypeError: Memcached::setMulti(): Argument #2 ($expiration) must be of type int, int given" .

It works in php8.0, but not in php8.1.

The Error " must be of type int, int given" is a bit confusing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions