%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/rs/php/8.3/lib/php/test/memcache/tests/
Upload File :
Create Path :
Current File : /home/rs/php/8.3/lib/php/test/memcache/tests/001.phpt

--TEST--
memcache_set() function
--SKIPIF--
<?php
if (PHP_VERSION_ID < 80000)
    die('skip php 8+ only');
include 'connect.inc';
--FILE--
<?php

include 'connect.inc';

$value = new stdClass;
$value->plain_attribute = 'value';
$value->array_attribute = array('test1', 'test2');
memcache_set($memcache, 'test_key', $value, false, 10);

$key = 123;
$value = 123;
memcache_set($memcache, $key, $value, false, 10);

var_dump($key);
var_dump($value);

try {
    memcache_set($memcache, $key);
} catch (ArgumentCountError $e) {
    echo "{$e->getMessage()}\n";
}

try {
    $memcache->set($key);
} catch (ArgumentCountError $e) {
    echo "{$e->getMessage()}\n";
}

echo "Done\n";

?>
--EXPECTF--
int(123)
int(123)
Wrong parameter count for memcache_set()
Wrong parameter count for MemcachePool::set()
Done

Zerion Mini Shell 1.0