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

Fix: Deprecated Warning for uasort() #3091

Merged
merged 1 commit into from
Nov 1, 2022
Merged

Fix: Deprecated Warning for uasort() #3091

merged 1 commit into from
Nov 1, 2022

Conversation

burhandodhy
Copy link
Contributor

Description of the Change

This PR fixes the deprecation warning that uasort throws on the PHP 8.

PHP 8 introduced the Stable Sorting RFC, which means that all sorting functions in PHP are now "stable".

The recommended way is to use the PHP spaceship operate for compare. Ref

Closes #3075

How to test the Change

  1. Install ElasticPress on PHP 8 environment.
  2. Import WooCommerce Dummy Content.
  3. Add the Taxonomy Facet and select the clothing term.

Changelog Entry

Fixed - Deprecated Warning: uasort(): Returning bool from comparison function is deprecated

Credits

Props @burhandodhy

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@felipeelia felipeelia added this to the 4.4.0 milestone Nov 1, 2022
@felipeelia felipeelia merged commit 0cd96c5 into develop Nov 1, 2022
@felipeelia felipeelia deleted the burhan/fix-3075 branch November 1, 2022 11:47
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.

BUG: Deprecated Warning: uasort(): Returning bool from comparison function is deprecated
2 participants