File: 022a.phpt

package info (click to toggle)
php-memcache 3.0.9~20170802.e702b5f-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,172 kB
  • sloc: ansic: 9,126; php: 1,015; xml: 760; sh: 3; makefile: 1
file content (38 lines) | stat: -rw-r--r-- 1,165 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--TEST--
memcache_get_extended_stats()
--SKIPIF--
<?php include 'connect.inc'; if (!isset($host2)) die('skip $host2 not set'); if (ini_get('memcache.protocol') == 'binary') die('skip binary protocol does not support stats'); ?>
--FILE--
<?php

include 'connect.inc';

$memcache = new Memcache();
memcache_add_server($memcache, $nonExistingHost, $nonExistingPort);
memcache_add_server($memcache, $host, $port);
memcache_add_server($memcache, $host2, $port2);

$result1 = @memcache_get_stats($memcache);
$result2 = @memcache_get_extended_stats($memcache);
var_dump(memcache_get_extended_stats(array()));
var_dump(memcache_get_extended_stats(new stdClass));

var_dump($result1['pid']);

var_dump(count($result2));
var_dump($result2["$host:$port"]['pid']);
var_dump($result2["$host2:$port2"]['pid']);
var_dump($result2["$nonExistingHost:$nonExistingPort"]);

?>
--EXPECTF--
Warning: memcache_get_extended_stats() expects parameter 1 to be MemcachePool, array given in %s on line %d
NULL

Warning: memcache_get_extended_stats() expects parameter 1 to be MemcachePool, object given in %s on line %d
NULL
string(%d) "%d"
int(3)
string(%d) "%d"
string(%d) "%d"
bool(false)