--TEST-- memcache_close(), memcache_get() --SKIPIF-- = 80000) die('skip php prior to 8 only'); include 'connect.inc'; if (!isset($host2)) die('skip $host2 not set'); ?> --FILE-- connect($host, $port); $result3 = memcache_set($memcache, 'test_key', 'test', false, 1); $result4 = memcache_close($memcache); // This will fail since all servers have been removed $result5 = memcache_get($memcache, 'test_key'); var_dump($result2); var_dump($result3); var_dump($result4); var_dump($result5); var_dump(memcache_close($memcache)); var_dump(memcache_close($memcache)); try { var_dump(memcache_close(new stdClass)); } catch (TypeError $e) { echo "{$e->getMessage()}\n"; } try { var_dump(memcache_close("")); } catch (TypeError $e) { echo "{$e->getMessage()}\n"; } echo "Done\n"; ?> --EXPECTF-- bool(true) bool(true) bool(true) bool(true) bool(false) bool(true) bool(true) Argument 1 passed to memcache_close() must be an instance of MemcachePool, instance of stdClass given Argument 1 passed to memcache_close() must be an instance of MemcachePool, string given Done