mirror of
https://github.com/php-win-ext/pecl-memcache.git
synced 2026-03-24 00:52:07 +01:00
* Use zend_bool for ini bool settings Related to #56 * Initial work for php 8 * php7 -> php8 * Add test for #53 * Fix support for binary protocol * php8 -> src * Backwards compatibility with php 7.3, 7.4 This will allow us to have one unified branch that will compile under different versions of php. * Add test for pecl bug #77900 * Fix some memory leaks * Support for reflection - added / updated arginfos - fix functions returning NULL instead of advertised return type, For example, when memcached returned error on "delete", function returned null instead of false - added tests for both php8 and 7 * Fix typo * Update config.w32 Co-authored-by: Tyson Andre <tyson.andre@uwaterloo.ca> Co-authored-by: Tyson Andre <tysonandre775@hotmail.com> Co-authored-by: Tomas Srnka <tomassrnka@users.noreply.github.com> Co-authored-by: Tyson Andre <tyson.andre@uwaterloo.ca>
55 lines
1.2 KiB
PHP
55 lines
1.2 KiB
PHP
--TEST--
|
|
memcache_flush()
|
|
--SKIPIF--
|
|
<?php
|
|
if (PHP_VERSION_ID < 80000)
|
|
die('skip php 8+ only');
|
|
include 'connect.inc'; ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
// This test must be run last or some concurrency problems will occur
|
|
// since the "flush_all" seems to be done async and therefore will
|
|
// affect subsequent calls to set() done with a second or so.
|
|
|
|
include 'connect.inc';
|
|
|
|
$result = @memcache_flush($memcache);
|
|
var_dump($result);
|
|
|
|
memcache_add_server($memcache, $nonExistingHost, $nonExistingPort);
|
|
|
|
$result = @memcache_flush($memcache);
|
|
var_dump($result);
|
|
|
|
$memcache2 = new Memcache();
|
|
$memcache2->addServer($nonExistingHost, $nonExistingPort);
|
|
|
|
$result = @memcache_flush($memcache2);
|
|
var_dump($result);
|
|
|
|
memcache_close($memcache);
|
|
var_dump(memcache_flush($memcache));
|
|
try {
|
|
var_dump(memcache_flush(new stdClass));
|
|
} catch (TypeError $e) {
|
|
echo "{$e->getMessage()}\n";
|
|
}
|
|
try {
|
|
var_dump(memcache_flush(''));
|
|
} catch (TypeError $e) {
|
|
echo "{$e->getMessage()}\n";
|
|
}
|
|
|
|
echo "Done\n";
|
|
|
|
?>
|
|
--EXPECTF--
|
|
bool(true)
|
|
bool(false)
|
|
bool(false)
|
|
bool(true)
|
|
memcache_flush(): Argument #1 ($memcache) must be of type MemcachePool, stdClass given
|
|
memcache_flush(): Argument #1 ($memcache) must be of type MemcachePool, string given
|
|
Done
|