Skip to content
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

Union type declaration in Session.php is available as of PHP 8.0.0 #416

Open
mitkola opened this issue Nov 18, 2022 · 1 comment
Open

Union type declaration in Session.php is available as of PHP 8.0.0 #416

mitkola opened this issue Nov 18, 2022 · 1 comment

Comments

@mitkola
Copy link

mitkola commented Nov 18, 2022

Stash cache from version 0.17.0+ and later require PHP 7+, but there are union type declaration
which is available as of PHP 8.0.0.
This lead to syntax error in PHP 7+ environments!

public function gc($maxlifetime) : int|false

I suggest to use mixed return type and update PHP doc header.

@tedivm
Copy link
Member

tedivm commented Nov 18, 2022

If you make a PR I'll merge it.

mitkola added a commit to mitkola/Stash that referenced this issue Nov 19, 2022
Due to difference in SessionInterfaceHandler interface in PHP 7.x and PHP 8+
gc method return type was ommited and suppressed warning as PHP 8+
It's better for future to make different version of Stash for PHP 7.x and PHP 8+

Minor change was made also to remove cmpatibility with PHP version before 5.4.0
while Stash package is compatible with 7+.
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

No branches or pull requests

2 participants