Predis
PHP · Predis v3.6.1 · RESP2
Listed tests passed
Tested connection settings
Predis standalone connection
Test target: 127.0.0.1:6379, username default, fixture password manual-test-only, default database. This password is only for the disposable local test container.
Verified operations
- authenticated PING
- SET
- Unicode GET
- missing GET
- binary round trip
- HGET
- MULTI/EXEC
- Lua EVAL
Coverage is limited to the exact API calls and assertions in the program below.
Executable test example
This program ran inside the isolated Docker image. It contains multiple client branches; this page uses the arguments below. Dependencies and compilation steps are in the test directory's Dockerfile.
php "/clients/php-client.php" predisView the complete executed source
<?php
// Run: php php-client.php predis|phpredis. Fixture only.
$library=$argv[1]; $checks=[];
function verify($name,$actual,$expected) {global $checks;if($actual!==$expected)throw new Exception($name.': '.json_encode($actual));$checks[]=$name;}
if($library==='predis') {
require '/clients/vendor/autoload.php';
$client=new Predis\Client(['scheme'=>'tcp','host'=>'127.0.0.1','port'=>6379,'username'=>'default','password'=>'manual-test-only','read_write_timeout'=>5]);
$version=Composer\InstalledVersions::getPrettyVersion('predis/predis');
} else {
$client=new Redis();$client->connect('127.0.0.1',6379,5);$client->auth(['default','manual-test-only']);
$version=phpversion('redis');
}
try {
verify('authenticated PING',(string)$client->ping(),$library==='predis'?'PONG':'1');
$set=$client->set('php:text','Hello 世界');verify('SET',$library==='predis'?(string)$set:$set,$library==='predis'?'OK':true);
verify('Unicode GET',$client->get('php:text'),'Hello 世界');
verify('missing GET',$client->get('php:missing'),$library==='predis'?null:false);
$client->set('php:binary',"\0\xff\r\n");verify('binary round trip',$client->get('php:binary'),"\0\xff\r\n");
$client->hset('php:hash','field','value');verify('HGET',$client->hget('php:hash','field'),'value');
if($library==='predis') {
$values=$client->transaction(function($t){$t->set('php:counter','1');$t->incr('php:counter');});
verify('MULTI/EXEC',$values[1],2);
verify('Lua EVAL',$client->eval("return redis.call('GET',KEYS[1])",1,'php:counter'),'2');
} else {
$values=$client->multi()->set('php:counter','1')->incr('php:counter')->exec();verify('MULTI/EXEC',$values,[true,2]);
verify('Lua EVAL',$client->eval("return redis.call('GET',KEYS[1])",['php:counter'],1),'2');
}
} finally {if($library==='predis')$client->disconnect();else $client->close();}
echo json_encode(['library'=>$library,'version'=>$version,'checks'=>$checks,'status'=>'passed'])."\n";
Official client repository · Dependencies and reproduction
Test environment & reproducible evidence
Verified: 2026-09-21T11:15:27Z · Docker / Linux aarch64 · lavik 0.1.0-beta.1
Storage & connection: io_uring · temporary file, 2 workers, standalone, plaintext TCP, password authentication. This test does not measure NVMe performance.
Pinned source: 3955b98d43b312324aa8d52775df52cfb111c0d0
Binary SHA-256: 8306b37ddf05023f85166a6aa2192b7084757e8defd342b602e6470244aca887
Image: sha256:fd13690a1931b8abb31b1866baa2a08c7c38e6df93aa78883321d1d3c1cddd00