Skip to content

Live.getLastVisitsDetails API sort order different for PHP8 #18234

@AltamashShaikh

Description

@AltamashShaikh

Due to stable sorting in PHP 8, the result order seems to change when hitting same API on different PHP versions.

Expected Behavior

The output order should be same across all the versions

Current Behavior

The output differs for different PHP versions

Possible Solution

Changing the below code to renturn '-1' instead of '0'
https://github.com/matomo-org/matomo/blob/4.x-dev/plugins/Live/Visitor.php#L309

Steps to Reproduce (for Bugs)

If you have FormAnalytics plugin installed you can try executing the system test cases in PHP8 and the output will differ for you from PHP7.

Context

Trying to add PHP8 in travis build for FormAnalytics plugin and the build is failing due to this

Your Environment

  • Matomo Version:
  • PHP Version:
  • Server Operating System:
  • Additionally installed plugins:
  • Browser:
  • Operating System:

Metadata

Metadata

Labels

BugFor errors / faults / flaws / inconsistencies etc.not-in-changelogFor issues or pull requests that should not be included in our release changelog on matomo.org.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions