---
title: "Predis: pipelines and Sentinel in a PHP Redis client"
description: "Fixes in Predis, the PHP Redis client: pipeline response count after a lost connection, spl_object_id() instead of spl_object_hash() and SENTINEL REPLICAS."
url: "https://vulcode.com/en/opensource/contributions/predis"
lang: "en"
---

[All contributions](https://vulcode.com/en/opensource/contributions)

predis/predis

# Predis

A flexible, feature-complete Redis and Valkey client for PHP that handles single servers, clusters and replication through Sentinel.

[See the repository](https://github.com/predis/predis) [All contributions](https://vulcode.com/en/opensource/contributions)

- **Language**: PHP
- **GitHub stars**: 7,782
- **Merged changes**: 3

## What we changed

On a read error the ConnectionErrorProof pipeline returns the exception for the failed command and every one after it, and spl_object_id() replaces spl_object_hash(). Sentinel replica discovery uses SENTINEL REPLICAS and falls back to SENTINEL SLAVES on older servers.

### What this work shows

- Redis pipelines and connection errors

- Redis Sentinel and Redis 4 compatibility

- PHPUnit tests with data providers and mocks

- PHP 8.6 deprecations

What was broken

### Too few responses after a lost connection

When a read in the ConnectionErrorProof pipeline failed on a single node, executeSingleNode() counted the missing responses from a queue the commands had already been taken off. It then returned too short a list or threw a ValueError from array_fill().

How we fixed it

### An exception for every unfinished command

The missing responses are now counted from the pipeline size, so the failed command and all later ones get the connection exception, as in executeCluster(). A data provider test covers a failure on the first, a middle and the last command.

[#1739](https://github.com/predis/predis/pull/1739)

What was broken

### A deprecation warning on PHP 8.6

PHP 8.6 deprecates spl_object_hash(), and ConnectionErrorProof used it as the array key for per-connection exceptions in a cluster. The pipeline also had no test file of its own.

How we fixed it

### spl_object_id() and pipeline tests

The key now comes from spl_object_id(), which works the same way without the warning. We added ConnectionErrorProofTest with cases for a write failure on a single connection and one failing node in a cluster.

[#1738](https://github.com/predis/predis/pull/1738)

What was broken

### Replicas looked up with a legacy command

Predis looked up replicas with SENTINEL SLAVES, although Sentinel has offered SENTINEL REPLICAS since Redis 5.0. Older servers only know the old name, so simply swapping the command would break them.

How we fixed it

### SENTINEL REPLICAS with a fallback to SLAVES

querySentinelForSlaves() sends SENTINEL REPLICAS, and when the Sentinel replies that it does not know the subcommand, it retries with SENTINEL SLAVES. We added a connected test and ran it against Sentinels from Redis 4.0 and 7.4.

[#1745](https://github.com/predis/predis/pull/1745)

## Merged changes 3

- [#1745 Use SENTINEL REPLICAS for Sentinel replica discovery Merged 12 October 2026](https://github.com/predis/predis/pull/1745)

- [#1739 Fix ConnectionErrorProof response count on single node read errors Merged 8 October 2026](https://github.com/predis/predis/pull/1739)

- [#1738 Replace deprecated spl_object_hash() with spl_object_id() in ConnectionErrorProof Merged 8 October 2026](https://github.com/predis/predis/pull/1738)

## What it taught us

The number of missing responses has to come from the commands that were sent, not from a queue part of which is already gone. When we switch a protocol command, we keep a path for older servers and check it against a real Sentinel, not only a mock.

[More about this technology: PHP](https://vulcode.com/en/technologies/php)

## Other projects we write code for

- [**Composer** PHP · 29,590 stars The dependency manager for PHP: it installs and updates a project's libraries from its composer.json.](https://vulcode.com/en/opensource/contributions/composer)

- [**PHPMailer** PHP · 22,347 stars The classic PHP library for sending email, used by WordPress and many other systems.](https://vulcode.com/en/opensource/contributions/phpmailer)

- [**Monolog** PHP · 21,407 stars A PHP logging library that sends records to files, sockets, inboxes, databases and web services. Symfony and Laravel use it, among others.](https://vulcode.com/en/opensource/contributions/monolog)

- [**Carbon** PHP · 16,583 stars A PHP DateTime extension for working with dates, standard in the Laravel ecosystem.](https://vulcode.com/en/opensource/contributions/carbon)

- [**Whoops** PHP · 13,231 stars A PHP library that turns uncaught exceptions into a readable error page with the stack trace, known from Laravel.](https://vulcode.com/en/opensource/contributions/whoops)

- [**ramsey/uuid** PHP · 12,642 stars A PHP library for generating universally unique identifiers (UUIDs).](https://vulcode.com/en/opensource/contributions/ramsey-uuid)

## Describe your project.

A free quote comes back within an hour during working hours.

### Rather skip the form?

Ask in the chat or write to us directly.

Open the chat

- **Email**: [hello@vulcode.com](mailto:hello@vulcode.com)
- **Phone**: [+48 576 043 920](tel:+48576043920)
- **Discord**: [discord.gg/vulcode](https://discord.gg/vulcode)
