����JFIF��x�x����'
| Server IP : 78.140.185.180 / Your IP : 216.73.216.28 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/3357889/root/opt/cpanel/ea-php74/root/usr/share/tests/pecl/memcached/tests/ |
Upload File : |
--TEST--
Test valid and invalid keys - binary
--SKIPIF--
<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
$binary = memc_get_instance (array (
Memcached::OPT_BINARY_PROTOCOL => true,
));
echo 'BINARY: SPACES' . PHP_EOL;
var_dump ($binary->set ('binary key with spaces', 'this is a test'));
var_dump ($binary->getResultCode () == Memcached::RES_SUCCESS);
echo 'BINARY: NEWLINE' . PHP_EOL;
var_dump ($binary->set ('binarykeywithnewline' . PHP_EOL, 'this is a test'));
var_dump ($binary->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED);
echo 'BINARY: EMPTY' . PHP_EOL;
var_dump ($binary->set (''/*empty key*/, 'this is a test'));
var_dump ($binary->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED);
echo 'BINARY: TOO LONG' . PHP_EOL;
var_dump ($binary->set (str_repeat ('1234567890', 512), 'this is a test'));
var_dump ($binary->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED);
echo 'BINARY: GET' . PHP_EOL;
// Only newline fails in binary mode (char 10)
for ($i=0;$i<32;$i++) {
$binary->delete ('binarykeywithnonprintablechar-' . chr($i) . '-here');
var_dump ($binary->get ('binarykeywithnonprintablechar-' . chr($i) . '-here'));
var_dump ($binary->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED);
}
echo 'BINARY: SET' . PHP_EOL;
// Only newline fails in binary mode (char 10)
for ($i=0;$i<32;$i++) {
var_dump ($binary->set ('binarykeywithnonprintablechar-' . chr($i) . '-here', 'this is a test'));
var_dump ($binary->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED);
$binary->delete ('binarykeywithnonprintablechar-' . chr($i) . '-here');
}
echo 'OK' . PHP_EOL;
--EXPECT--
BINARY: SPACES
bool(true)
bool(true)
BINARY: NEWLINE
bool(false)
bool(true)
BINARY: EMPTY
bool(false)
bool(true)
BINARY: TOO LONG
bool(false)
bool(true)
BINARY: GET
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(true)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
BINARY: SET
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(false)
bool(true)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
OK