Doc #61344 [Opn->Csd]: Failure Callback Parameters
| From: | krakjoe@php.net | Date: | Sat, 01 Feb 2014 10:12:00 +0000 |
| Subject: | Doc #61344 [Opn->Csd]: Failure Callback Parameters | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-10921@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61344&edit=1
ID: 61344
Updated by: krakjoe@php.net
Reported by: adam at adamhahn dot com
Summary: Failure Callback Parameters
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: CentOS 5.7
PHP Version: 5.3.10
-Assigned To:
+Assigned To: krakjoe
Block user comment: N
Private report: N
New Comment:
The API is now documented differently, this would seem to resolve the issue, I'm not sure when
this happened.
Thanks for taking the time to make PHP better :)
Previous Comments:
------------------------------------------------------------------------
[2012-03-10 16:25:23] adam at adamhahn dot com
Description:
------------
---
From manual page: http://www.php.net/memcache.addserver#refsect1-memcache.addserver-parameters
---
The failure callback function for memcache::addServer is passed more than just the two parameters
listed within the documentation.
In addition to passing the hostname and port, three additional callback parameters are passed.
There is a user submitted note regarding this (jwatte at imvu dot com 08-Sep-2011 06:02) however it
seems that the note has the last two parameters switched.
Test script:
---------------
$memcache = new Memcache();
$callback = function() {
print_r(func_get_args());
die();
};
// localhost memcache is offline/stopped
$memcache->addServer('localhost', 11211, false, 5, 1, 15, true, $callback);
$memcache->set('foo', 'bar');
Expected result:
----------------
According to the existing documentation
Array
(
[0] => localhost
[1] => 11211
)
Actual result:
--------------
Array
(
[0] => localhost
[1] => 11211
[2] => 0
[3] => Connection refused
[4] => 111
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61344&edit=1