mirror of
https://github.com/php-win-ext/php-memcached.git
synced 2026-04-24 01:08:03 +02:00
32 lines
481 B
PHP
32 lines
481 B
PHP
--TEST--
|
|
Test that callback is invoked on new object
|
|
--SKIPIF--
|
|
<?php if (!extension_loaded("memcached")) print "skip"; ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
function my_func(Memcached $obj, $persistent_id = null)
|
|
{
|
|
$obj->addServer("127.0.0.1", 11211);
|
|
}
|
|
|
|
$m = new Memcached('hi', 'my_func');
|
|
|
|
var_dump($m->getServerList());
|
|
|
|
echo "OK\n";
|
|
|
|
--EXPECTF--
|
|
array(1) {
|
|
[0]=>
|
|
array(3) {
|
|
["host"]=>
|
|
string(9) "127.0.0.1"
|
|
["port"]=>
|
|
int(11211)
|
|
["weight"]=>
|
|
int(%r[01]%r)
|
|
}
|
|
}
|
|
OK
|