We should at a later step consider to switch to PHP 8.1. But it seems currently the tests would fail there.
@justinvelluppillai @bx80 @peterhashair I will merge this, as it will fix the failing tests for now. Switching to PHP 8.1 wasn't easily possible here, as tests were not passing. See https://app.travis-ci.com/github/matomo-org/matomo/builds/249369916
Guess we should plan in some time next milestone to switch tests to PHP 8.1 as it might take some more time to also fix the deprecation notices as well.
Be good if you can create an issue for that in the next milestone