php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #60640 Invalid return values
Submitted: 2012-01-03 10:01 UTC Modified: 2012-02-16 21:08 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: drak at zikula dot org Assigned: frozenfire (profile)
Status: Closed Package: Session related
PHP Version: 5.4.0RC4 OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: drak at zikula dot org
New email:
PHP Version: OS:

 

 [2012-01-03 10:01 UTC] drak at zikula dot org
Description:
------------
According to the documentation at 
http://www.php.net/manual/en/class.sessionhandler.php the various methods return 0 
for success and 1 for failure which is kind of backwards since 0 would normally be 
evaluated as false and 1 as true.  This is in direct contradiction with the 
current expected behaviour of session_set_save_handler() 
http://www.php.net/manual/en/function.session-set-save-handler.php which expects 
true or false return values except for the read handler which should always return 
a string.  What's the deal here?

I think the return values really should be true and false for this class, as 
expected by session_set_save_handler()

Expected result:
----------------
I would expect the methods of SessionHandler class to return back true or false 
for all methods except read() which should return a string, as expected by the 
session_set_save_handler()


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-03 16:25 UTC] arpad@php.net
-Assigned To: +Assigned To: arpad
 [2012-01-04 01:31 UTC] arpad@php.net
Automatic comment from SVN on behalf of arpad
Revision: http://svn.php.net/viewvc/?view=revision&revision=321741
Log: fix return values of inherited session handler to match user handlers - #60640
 [2012-01-04 01:34 UTC] arpad@php.net
-Status: Assigned +Status: To be documented
 [2012-01-04 01:34 UTC] arpad@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2012-01-07 14:22 UTC] bjori@php.net
-Status: To be documented +Status: Open -Type: Bug +Type: Documentation Problem
 [2012-01-08 05:31 UTC] drak at zikula dot org
The documentation at php.net needs to be updated e.g. 
http://www.php.net/manual/en/sessionhandler.gc.php still shows the wrong return 
values. I noticed also that SessionHandlerInterface was also added since RC5 which 
is not yet documented.
 [2012-01-10 12:51 UTC] arpad@php.net
Please don't assign bugs to other people - I'm returning this to open in case someone else can get to it first.
 [2012-01-10 12:51 UTC] arpad@php.net
-Status: Assigned +Status: Open -Assigned To: arpad +Assigned To:
 [2012-01-22 06:39 UTC] drak at zikula dot org
How can I join the documentation team?  I would like to contribute to this.
 [2012-01-25 00:00 UTC] frozenfire@php.net
If you would like to handle this bug yourself, pop into #php.doc on EFnet IRC. 
I'd be happy to bring you up to speed on how the documentation is written.
 [2012-02-16 21:08 UTC] frozenfire@php.net
Automatic comment from SVN on behalf of frozenfire
Revision: http://svn.php.net/viewvc/?view=revision&revision=323264
Log: Fixed the session handler return values, based on rev 321741.
Fixed the session handler prototypes to reflect correct return types.
Credit to Drak. Closes bug #60640.
 [2012-02-16 21:08 UTC] frozenfire@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-02-16 21:08 UTC] frozenfire@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: frozenfire
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 16:01:26 2024 UTC