Skip to content

Fix return type of SessionHandler::read() #6884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

kocsismate
Copy link
Member

No description provided.

@nikic
Copy link
Member

nikic commented Apr 20, 2021

https://www.php.net/manual/en/sessionhandlerinterface.read.php only talks about string return. The implementation seems to treat any non-string return as failure.

I think this change is fine, but how did you run across it?

@kocsismate
Copy link
Member Author

I think this change is fine, but how did you run across it?

When I was working on #6548, I added a lot of return type declarations to child methods of internal classes so that the deprecation notice is avoided. And then I noticed that a session test is failing (I believe it was ext/session/tests/session_set_save_handler_class_005.phpt) because the false return value of the parent::read($id) got converted to "".

Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks.

@kocsismate
Copy link
Member Author

Closing via ffb1ff3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants