PHP callback function not being called

Posted by Industrial on Stack Overflow See other posts from Stack Overflow or by Industrial
Published on 2010-05-22T18:15:45Z Indexed on 2010/05/22 18:20 UTC
Read the original article Hit count: 142

Filed under:
|
|
|
|

Hi everyone,

I've got the following code:

function _callback_memcache_failure($host, $port) {
    print "memcache '$host:$port' failed";
}

$this->memcache = new Memcache;

$this->memcache->addServer('192.168.1.35', '11211', 0, 50, 10, TRUE, _callback_memcache_failure('192.168.1.35','11211'));

The server is online and running (verified!), but the Failure callback function is being called at each connection. Why is that?

Reference:

PHP documentation: Memcache::addServer -> failure_callback

Allows the user to specify a callback function to run upon encountering an error. The callback is run before failover is attempted. The function takes two parameters, the hostname and port of the failed server

.

© Stack Overflow or respective owner

Related posts about php

Related posts about function