File: invoke_callback.phpt

package info (click to toggle)
php-memcached 3.1.5%2B2.2.0-5%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,952 kB
  • sloc: ansic: 9,587; xml: 1,318; php: 385; pascal: 87; sh: 12; makefile: 5
file content (34 lines) | stat: -rw-r--r-- 540 bytes parent folder | download | duplicates (5)
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
--TEST--
Test that callback is invoked on new object
--SKIPIF--
<?php include "skipif.inc";?>
--FILE--
<?php

include dirname (__FILE__) . '/config.inc';

function my_func(Memcached $obj, $persistent_id = null)
{
	$obj->addServer(MEMC_SERVER_HOST, MEMC_SERVER_PORT);
}

$m = new Memcached('hi', 'my_func');
$m = new Memcached('hi', 'my_func');

var_dump($m->getServerList());

echo "OK\n";

--EXPECTF--
array(1) {
  [0]=>
  array(3) {
    ["host"]=>
    string(9) "%s"
    ["port"]=>
    int(%d)
    ["type"]=>
    string(3) "TCP"
  }
}
OK