|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-05-22 16:28 UTC] info at theindustry dot se
Description:
------------
Hi everyone,
If I try to connect to a memcached server that doesnt exist or is running, the connect is always True, but if I enter a host name that is obviously wrong, the return is False.
This appears very strange to me. Shouldn't the memcache return FALSE when a connection couldnt be made, as according to the PHP documentation?
Reproduce code:
---------------
1:
$testInstance = new Memcache;
$var = @$testInstance->connect('localhost', 11211);
echo $var;
// Outputs true no matter if the memcached is running or not.
2:
$testInstance = new Memcache;
$var = @$testInstance->connect('blablabla', 11211);
echo $var;
// Outputs false
Actual result:
--------------
Result of connections to non-existent servers returns true.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 06:00:01 2025 UTC |
I cannot recreate this. My memcached server runs on port 11212. Code: <?php $testInstance = new Memcache; $var = @$testInstance->connect('localhost', 11212); var_dump($var); $testInstance = new Memcache; $var = @$testInstance->connect('localhost', 11211); var_dump($var); Output: bool(true) bool(false)