php / php/doc-en

SessionHandlerInterface::gc returning true is not allowed (contradicts example and session_set_save_handler callable)

Open
#2,268 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Extension: session
Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

From manual page: https://php.net/class.sessionhandlerinterface


The SessionHandlerInterface documentation for method gc states that it may only return int|false. It also states in the method gc documentation that it used to also return true before PHP 7.1.

Two things contradict these statements:

  1. The example code given on the SessionHandlerInterface documentation lets method gc return true
  2. The session_set_save_handler documentation states that if individual callables are provided, the gc callable must return bool (true or false)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the SessionHandlerInterface documentation and example at https://php.net/class.sessionhandlerinterface with the session_set_save_handler documentation cited in the issue. Determine the consistent return-value wording and update the affected documentation so the method description, example, and callable guidance no longer contradict one another.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.