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: 2021-04-13 13:19 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: cmb (profile)
Status: Closed Package: Session related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: reimo at warranty dot ee
New email:
PHP Version: OS:

 

 [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.
 [2021-04-13 13:19 UTC] cmb@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-04-13 13:19 UTC] cmb@php.net
This has been fixed in the meantime[1].

[1] <https://github.com/php/doc-en/commit/151e61773c016edcae8fd4989ad9a86ffd03c283>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC