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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
21 - 21 = ?
Subscribe to this entry?

 
 [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: Wed Apr 24 01:01:31 2024 UTC