<?php
// These stubs were generated by the phan stub generator.
// @phan-stub-for-extension memcached@3.3.0

namespace {
class Memcached {

    // constants
    const LIBMEMCACHED_VERSION_HEX = 16781316;
    const OPT_COMPRESSION = -1001;
    const OPT_COMPRESSION_TYPE = -1004;
    const OPT_COMPRESSION_LEVEL = -1007;
    const OPT_PREFIX_KEY = -1002;
    const OPT_SERIALIZER = -1003;
    const OPT_USER_FLAGS = -1006;
    const OPT_STORE_RETRY_COUNT = -1005;
    const OPT_ITEM_SIZE_LIMIT = -1008;
    const HAVE_IGBINARY = true;
    const HAVE_ZSTD = false;
    const HAVE_JSON = true;
    const HAVE_MSGPACK = true;
    const HAVE_ENCODING = true;
    const HAVE_SESSION = true;
    const HAVE_SASL = true;
    const OPT_HASH = 2;
    const HASH_DEFAULT = 0;
    const HASH_MD5 = 1;
    const HASH_CRC = 2;
    const HASH_FNV1_64 = 3;
    const HASH_FNV1A_64 = 4;
    const HASH_FNV1_32 = 5;
    const HASH_FNV1A_32 = 6;
    const HASH_HSIEH = 7;
    const HASH_MURMUR = 8;
    const OPT_DISTRIBUTION = 9;
    const DISTRIBUTION_MODULA = 0;
    const DISTRIBUTION_CONSISTENT = 1;
    const DISTRIBUTION_VIRTUAL_BUCKET = 6;
    const OPT_LIBKETAMA_COMPATIBLE = 16;
    const OPT_LIBKETAMA_HASH = 17;
    const OPT_TCP_KEEPALIVE = 32;
    const OPT_BUFFER_WRITES = 10;
    const OPT_BINARY_PROTOCOL = 18;
    const OPT_NO_BLOCK = 0;
    const OPT_TCP_NODELAY = 1;
    const OPT_SOCKET_SEND_SIZE = 4;
    const OPT_SOCKET_RECV_SIZE = 5;
    const OPT_CONNECT_TIMEOUT = 14;
    const OPT_RETRY_TIMEOUT = 15;
    const OPT_DEAD_TIMEOUT = 36;
    const OPT_SEND_TIMEOUT = 19;
    const OPT_RECV_TIMEOUT = 20;
    const OPT_POLL_TIMEOUT = 8;
    const OPT_CACHE_LOOKUPS = 6;
    const OPT_SERVER_FAILURE_LIMIT = 21;
    const OPT_AUTO_EJECT_HOSTS = 28;
    const OPT_HASH_WITH_PREFIX_KEY = 25;
    const OPT_NOREPLY = 26;
    const OPT_SORT_HOSTS = 12;
    const OPT_VERIFY_KEY = 13;
    const OPT_USE_UDP = 27;
    const OPT_NUMBER_OF_REPLICAS = 29;
    const OPT_RANDOMIZE_REPLICA_READ = 30;
    const OPT_REMOVE_FAILED_SERVERS = 35;
    const OPT_SERVER_TIMEOUT_LIMIT = 37;
    const RES_SUCCESS = 0;
    const RES_FAILURE = 1;
    const RES_HOST_LOOKUP_FAILURE = 2;
    const RES_CONNECTION_FAILURE = 3;
    const RES_CONNECTION_BIND_FAILURE = 4;
    const RES_WRITE_FAILURE = 5;
    const RES_READ_FAILURE = 6;
    const RES_UNKNOWN_READ_FAILURE = 7;
    const RES_PROTOCOL_ERROR = 8;
    const RES_CLIENT_ERROR = 9;
    const RES_SERVER_ERROR = 10;
    const RES_DATA_EXISTS = 12;
    const RES_DATA_DOES_NOT_EXIST = 13;
    const RES_NOTSTORED = 14;
    const RES_STORED = 15;
    const RES_NOTFOUND = 16;
    const RES_PARTIAL_READ = 18;
    const RES_SOME_ERRORS = 19;
    const RES_NO_SERVERS = 20;
    const RES_END = 21;
    const RES_DELETED = 22;
    const RES_VALUE = 23;
    const RES_STAT = 24;
    const RES_ITEM = 25;
    const RES_ERRNO = 26;
    const RES_FAIL_UNIX_SOCKET = 27;
    const RES_NOT_SUPPORTED = 28;
    const RES_NO_KEY_PROVIDED = 29;
    const RES_FETCH_NOTFINISHED = 30;
    const RES_TIMEOUT = 31;
    const RES_BUFFERED = 32;
    const RES_BAD_KEY_PROVIDED = 33;
    const RES_INVALID_HOST_PROTOCOL = 34;
    const RES_SERVER_MARKED_DEAD = 35;
    const RES_UNKNOWN_STAT_KEY = 36;
    const RES_INVALID_ARGUMENTS = 38;
    const RES_PARSE_ERROR = 43;
    const RES_PARSE_USER_ERROR = 44;
    const RES_DEPRECATED = 45;
    const RES_IN_PROGRESS = 46;
    const RES_MAXIMUM_RETURN = 49;
    const RES_MEMORY_ALLOCATION_FAILURE = 17;
    const RES_CONNECTION_SOCKET_CREATE_FAILURE = 11;
    const RES_E2BIG = 37;
    const RES_KEY_TOO_BIG = 39;
    const RES_SERVER_TEMPORARILY_DISABLED = 47;
    const RES_SERVER_MEMORY_ALLOCATION_FAILURE = 48;
    const RES_AUTH_PROBLEM = 40;
    const RES_AUTH_FAILURE = 41;
    const RES_AUTH_CONTINUE = 42;
    const RES_PAYLOAD_FAILURE = -1001;
    const SERIALIZER_PHP = 1;
    const SERIALIZER_IGBINARY = 2;
    const SERIALIZER_JSON = 3;
    const SERIALIZER_JSON_ARRAY = 4;
    const SERIALIZER_MSGPACK = 5;
    const COMPRESSION_FASTLZ = 2;
    const COMPRESSION_ZLIB = 1;
    const COMPRESSION_ZSTD = 3;
    const GET_PRESERVE_ORDER = 1;
    const GET_EXTENDED = 2;
    const GET_ERROR_RETURN_VALUE = false;

    // methods
    public function __construct(?string $persistent_id = null, ?callable $callback = null, ?string $connection_str = null) {}
    public function getResultCode() : int {}
    public function getResultMessage() : string {}
    public function get(string $key, ?callable $cache_cb = null, int $get_flags = 0) : mixed {}
    public function getByKey(string $server_key, string $key, ?callable $cache_cb = null, int $get_flags = 0) : mixed {}
    public function getMulti(array $keys, int $get_flags = 0) : array|false {}
    public function getMultiByKey(string $server_key, array $keys, int $get_flags = 0) : array|false {}
    public function getDelayed(array $keys, bool $with_cas = false, ?callable $value_cb = null) : bool {}
    public function getDelayedByKey(string $server_key, array $keys, bool $with_cas = false, ?callable $value_cb = null) : bool {}
    public function fetch() : array|false {}
    public function fetchAll() : array|false {}
    public function set(string $key, mixed $value, int $expiration = 0) : bool {}
    public function setByKey(string $server_key, string $key, mixed $value, int $expiration = 0) : bool {}
    public function touch(string $key, int $expiration = 0) : bool {}
    public function touchByKey(string $server_key, string $key, int $expiration = 0) : bool {}
    public function setMulti(array $items, int $expiration = 0) : bool {}
    public function setMultiByKey(string $server_key, array $items, int $expiration = 0) : bool {}
    public function cas(float|int|string $cas_token, string $key, mixed $value, int $expiration = 0) : bool {}
    public function casByKey(float|int|string $cas_token, string $server_key, string $key, mixed $value, int $expiration = 0) : bool {}
    public function add(string $key, mixed $value, int $expiration = 0) : bool {}
    public function addByKey(string $server_key, string $key, mixed $value, int $expiration = 0) : bool {}
    public function append(string $key, string $value) : ?bool {}
    public function appendByKey(string $server_key, string $key, string $value) : ?bool {}
    public function prepend(string $key, string $value) : ?bool {}
    public function prependByKey(string $server_key, string $key, string $value) : ?bool {}
    public function replace(string $key, mixed $value, int $expiration = 0) : bool {}
    public function replaceByKey(string $server_key, string $key, mixed $value, int $expiration = 0) : bool {}
    public function delete(string $key, int $time = 0) : bool {}
    public function deleteMulti(array $keys, int $time = 0) : array {}
    public function deleteByKey(string $server_key, string $key, int $time = 0) : bool {}
    public function deleteMultiByKey(string $server_key, array $keys, int $time = 0) : array {}
    public function increment(string $key, int $offset = 1, int $initial_value = 0, int $expiry = 0) : false|int {}
    public function decrement(string $key, int $offset = 1, int $initial_value = 0, int $expiry = 0) : false|int {}
    public function incrementByKey(string $server_key, string $key, int $offset = 1, int $initial_value = 0, int $expiry = 0) : false|int {}
    public function decrementByKey(string $server_key, string $key, int $offset = 1, int $initial_value = 0, int $expiry = 0) : false|int {}
    public function addServer(string $host, int $port, int $weight = 0) : bool {}
    public function addServers(array $servers) : bool {}
    public function getServerList() : array {}
    public function getServerByKey(string $server_key) : array|false {}
    public function resetServerList() : bool {}
    public function quit() : bool {}
    public function flushBuffers() : bool {}
    public function getLastErrorMessage() : string {}
    public function getLastErrorCode() : int {}
    public function getLastErrorErrno() : int {}
    public function getLastDisconnectedServer() : array|false {}
    public function getStats(?string $type = null) : array|false {}
    public function getVersion() : array|false {}
    public function getAllKeys() : array|false {}
    public function flush(int $delay = 0) : bool {}
    public function getOption(int $option) : mixed {}
    public function setOption(int $option, mixed $value) : bool {}
    public function setOptions(array $options) : bool {}
    public function setBucket(array $host_map, ?array $forward_map, int $replicas) : bool {}
    public function setSaslAuthData(string $username, string $password) : bool {}
    public function setEncodingKey(string $key) : bool {}
    public function isPersistent() : bool {}
    public function isPristine() : bool {}
    public function checkKey(string $key) : bool {}
}

class MemcachedException extends \RuntimeException {

    // properties
    protected $message;
    protected $code;
    protected $file;
    protected $line;
}

}
