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

[php8-compat] Fix issue with returning bool from uasort by using the … #20502

Merged
merged 1 commit into from
Jun 5, 2021

Conversation

seamuslee001
Copy link
Contributor

…spaceship operator

Overview

This fixes an error in php8

uasort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero

Before

Error shows in php8

After

No error

Technical Details

As per this https://stackoverflow.com/questions/65382799/what-happened-in-php8-0-0-to-break-usort-intstrlenastrlenb the recommended solution is to use the spaceship <=> operator

ping @eileenmcnaughton @totten @demeritcowboy

@civibot
Copy link

civibot bot commented Jun 4, 2021

(Standard links)

@eileenmcnaughton
Copy link
Contributor

OK - this makes sense & they all seem to be sort functions

@seamuslee001 seamuslee001 merged commit 7e7347b into civicrm:master Jun 5, 2021
@seamuslee001 seamuslee001 deleted the spaceship branch June 5, 2021 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants