1--TEST--
2Memcached virtual buckets
3--SKIPIF--
4<?php
5include dirname(__FILE__) . "/skipif.inc";
6if (!defined("Memcached::DISTRIBUTION_VIRTUAL_BUCKET")) die ("skip DISTRIBUTION_VIRTUAL_BUCKET not defined");
7if (PHP_VERSION_ID >= 80000) die("skip PHP 7 only");
8?>
9--FILE--
10<?php
11include dirname (__FILE__) . '/config.inc';
12$m = memc_get_instance (array (
13							Memcached::OPT_DISTRIBUTION => Memcached::DISTRIBUTION_VIRTUAL_BUCKET
14						));
15
16var_dump ($m->setBucket (array (), null, 2));
17
18var_dump ($m->setBucket (array (), array (), -1));
19
20var_dump ($m->setBucket (null, array (), -1));
21
22var_dump ($m->setBucket (array (-1), array (-1), 1));
23
24echo "OK\n";
25
26?>
27--EXPECTF--
28
29Warning: Memcached::setBucket(): server map cannot be empty in %s on line %d
30bool(false)
31
32Warning: Memcached::setBucket(): server map cannot be empty in %s on line %d
33bool(false)
34
35Warning: Memcached::setBucket() expects parameter 1 to be array, null given in %s on line %d
36NULL
37
38Warning: Memcached::setBucket(): the map must contain positive integers in %s on line %d
39bool(false)
40OK
41