Skip to content

DOC-7345 Add a Predis set member expiration example to the sets page - #4662

Merged
andy-stark-redis merged 1 commit into
mainfrom
DOC-7345-predis-set-member-expiration
Nov 25, 2026
Merged

andy-stark-redis merged 1 commit into
mainfrom
DOC-7345-predis-set-member-expiration

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Adds a member_expiration step to the PHP sets_tutorial example (SADDEX with a 900-second TTL, SADD, STTL) and adds PHP to that step's lang_filter on the sets page. Node.js already had this step.

Run-verified with the example harness on redis:8.12-rc2 (the server reports redis_version:8.11.241) against Predis v3.8.0. The new step prints 1, 1, [900,900,-1], and the whole DtSetsTest passes.

Parked #4526 adds a Jedis step to the same block, so whichever merges second needs a one-line lang_filter merge. This PR is against main because Predis 3.8.0 is already released.

🤖 Generated with Claude Code


Note

Low Risk
Documentation and local PHP example harness only; no runtime or security-sensitive code paths.

Overview
Extends the sets member expiration tutorial so PHP (Predis) appears alongside Node.js on the docs page by updating the clients-example lang_filter to Node.js,PHP.

Adds a matching member_expiration step to DtSetsTest.php: SADDEX with a 900-second TTL for two members, SADD for a third without expiry, and STTL to show [900,900,-1], with PHPUnit assertions and cleanup.

Reviewed by Cursor Bugbot for commit 6d52913. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds a `member_expiration` step to the PHP `sets_tutorial` file (SADDEX
with `'ex', 900`, SADD, STTL) and adds PHP to the existing step's
`lang_filter` on sets.md. Node.js already had the step; this mirrors it.

Run-verified with the harness on redis:8.12-rc2 (server reports
8.11.241, the rc2 version string) against Predis v3.8.0. The step prints
1, 1, [900,900,-1].

Learned:
- The harness's portable PHP install only runs `composer require` when
  vendor/predis is missing, so work/php can sit on an old Predis. It was
  v3.5.1, which fails with "Command `SADDEX` is not a registered Redis
  command". `composer update predis/predis` in build/example-test-harness/work/php
  fixes it; work/ is gitignored.
- The example passes the SADDEX condition and TTL modifier as string
  literals ('' and 'ex') instead of SADDEX::COND_NULL and TTL_EX, so the
  step needs no `use` import outside the STEP block.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

DOC-7345

@github-actions

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 5 related items from repository history (5 new this commit):

Memory updated at 6d52913

@github-actions

Copy link
Copy Markdown
Contributor

@dwdougherty dwdougherty left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@andy-stark-redis
andy-stark-redis merged commit b8fedab into main Nov 25, 2026
116 checks passed
@andy-stark-redis
andy-stark-redis deleted the DOC-7345-predis-set-member-expiration branch November 25, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients Client library docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants