php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #79771 Data type mismatch on the documentation page
Submitted: 2020-07-02 11:24 UTC Modified: 2020-07-02 12:15 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: reimo at warranty dot ee Assigned:
Status: Verified Package: Session related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2020-07-02 11:24 UTC] reimo at warranty dot ee
Description:
------------
---
From manual page: https://php.net/sessionhandler.gc
---
There seems to be data type mismatch on the documentation page https://www.php.net/manual/en/sessionhandler.gc.php where in the method declaration it is mentioned INT as a return type but later in the Return Values section it is mentioned BOOLEAN (TRUE, FALSE) type.

Test script:
---------------
I defined gc method for a custom session handler as:

public function gc($maxlifetime): bool

and it worked as expected. Platform: Debian 10, PHP 7.3.14


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-07-02 12:15 UTC] cmb@php.net
-Status: Open +Status: Verified -Package: Documentation problem +Package: Session related
 [2020-07-02 12:15 UTC] cmb@php.net
As of PHP 7.1.0, the return type is actually int, and is supposed
to be the number of garbage collected (i.e. deleted) sessions.
Previously, the return type was bool, signaling success or
failure.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Oct 28 21:01:24 2020 UTC