@Findus23 opened this Issue on June 17th 2021 Member

The first alpha of php8.1 was just released:
https://www.php.net/archive/2021.php#2021-06-10-1

There are a few breaking changes, so it might be useful to already start fixing things to get them released in time.

Changes: https://github.com/php/php-src/blob/php-8.1.0alpha1/UPGRADING

The major breaking change is that built-in functions now (just like user-defined functions) no longer accept null in non-nullable arguments:
https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg


  • [ ] monolog datetime

    Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /home/lukas/public_html/matomophp8/vendor/monolog/monolog/src/Monolog/Logger.php on line 324

  • fixed in https://github.com/Seldaek/monolog/pull/1554
  • fix released in monolog/monolog 1.26.1
  • fixed by #17828

  • [x] glob in upgradephp

    WARNING [2021-06-17 21:51:48] 298624 /home/lukas/public_html/matomophp8/libs/upgradephp/upgrade.php(260): Deprecated - glob(): Passing null to parameter #2 ($flags) of type int is deprecated - Matomo 4.0.0-b3 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)

  • fixed by https://github.com/matomo-org/matomo/pull/17687

  • [x] db logging string instead of array

    WARNING [2021-06-17 22:11:46] 311625 /home/lukas/public_html/matomophp8/core/Db.php(829): Warning - foreach() argument must be of type array|object, string given - Matomo 4.4.0-b1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)

  • when running ./console core:update
  • fixed by #17688

  • [ ] PDO fetch default

    WARNING [2021-06-17 22:27:06] 321855 /home/lukas/public_html/matomophp8/libs/Zend/Db/Statement/Pdo.php(257): Deprecated - PDOStatement::fetch(): Passing null to parameter #2 ($cursorOrientation) of type int is deprecated - Matomo 4.4.0-b1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)
    WARNING [2021-06-17 22:28:30] 322336 /home/lukas/public_html/matomophp8/libs/Zend/Db/Statement/Pdo.php(257): Deprecated - PDOStatement::fetch(): Passing null to parameter #3 ($cursorOffset) of type int is deprecated - Matomo 4.4.0-b1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)

  • fixed in https://github.com/matomo-org/matomo/pull/17689

  • [x] null site id

    WARNING [2021-06-18 08:20:57] 24637 /home/lukas/public_html/matomophp8/core/Site.php(433): Deprecated - explode(): Passing null to parameter #2 ($string) of type string is deprecated - Matomo 4.4.0-b1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)
    WARNING [2021-06-18 08:24:50] 25583 /home/lukas/public_html/matomophp8/plugins/CoreConsole/Commands/CoreArchiver.php(59): Deprecated - explode(): Passing null to parameter #2 ($string) of type string is deprecated - Matomo 4.4.0-b1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)

  • fixed in https://github.com/matomo-org/matomo/pull/17693

  • [ ] expects rows of numeric values

    Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=16&period=month&date=2020-09-01&format=json&trigger=archivephp. Response was
    DataArray->sumMetricsPivot expects rows of numeric values, non numeric found: '2020-09-14' for column 0 - in plugin Cohorts. #0 \/home\/lukas\/public_html\/matomophp8\/core\/ArchiveProcessor\/Loader.php(218): Piwik\ArchiveProcessor\PluginsArchiver->callAggregateAllPlugins(1, 0, false) #1 \/home\/lukas\/public_html\/matomophp8\/core\/ArchiveProcessor\/Loader.php(158): Piwik\ArchiveProcessor\Loader->prepareAllPluginsArchive(1, 0) #2 \/home\/lukas\/public_html\/matomophp8\/core\/ArchiveProcessor\/Loader.php(101): Piwik\ArchiveProcessor\Loader->prepareArchiveImpl('VisitsSummary') #3 \/home\/lukas\/public_html\/matomophp8\/core\/Context.php(75): Piwik\ArchiveProcessor\Loader->Piwik\ArchiveProcessor\{closure}() #4 \/home\/lukas\/public_html\/matomophp8\/core\/ArchiveProcessor\/Loader.php(105): Piwik\Context::changeIdSite(16, Object(Closure)) #5 \/home\/lukas\/public_html\/matomophp8\/plugins\/CoreAdminHome\/API.php(278): Piwik\ArchiveProcessor\Loader->prepareArchive('VisitsSummary') #6 \/home\/lukas\/public_html\/matomophp8\/core\/Archive.php(830): Piwik\Plugins\CoreAdminHome\API->archiveReports(16, Object(Piwik\Period\Week), '2020-09-14', '', 'VisitsSummary', '') #7 \/home\/lukas\/public_html\/matomophp8\/core\/Archive.php(629): Piwik\Archive->prepareArchive(Array, Object(Piwik\Site), Object(Piwik\Period\Week)) #8 \/home\/lukas\/public_html\/matomophp8\/core\/Archive.php(576): Piwik\Archive->cacheArchiveIdsAfterLaunching(Array, Array) #9 \/home\/lukas\/public_html\/matomophp8\/core\/Archive.php(502): Piwik\Archive->getArchiveIds(Array) #10 \/home\/lukas\/public_html\/matomophp8\/core\/Archive.php(312): Piwik\Archive->get(Array, 'numeric')
    [...]

  • not sure if this one is related to php8.1

  • [ ] strtoupper null

    WARNING [2021-06-18 11:15:28] 107661 /home/lukas/public_html/matomophp8/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php(256): Deprecated - strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated - Matomo 4.4.0-b1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)

  • not sure how to elegantly solve this
    https://github.com/matomo-org/matomo/blob/c973567705a0065fdd7d7c7b11b80f1f0f1be350/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php#L256

  • [ ] substr_count null

    WARNING [2021-06-18 11:15:28] 107661 /home/lukas/public_html/matomophp8/core/Access.php(164): Deprecated - substr_count(): Passing null to parameter #1 ($haystack) of type string is deprecated - Matomo 4.4.0-b1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)

  • https://github.com/matomo-org/matomo/blob/ea561b54613897b26d04cd25aafda92b66843b4b/core/Access.php#L164

  • [ ] more null during tracking

    PHP Deprecated: mb_strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /home/lukas/public_html/matomophp8/plugins/Referrers/Columns/Base.php on line 499
    PHP Deprecated: mb_strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /home/lukas/public_html/matomophp8/plugins/Referrers/Columns/Base.php on line 635
    PHP Deprecated: urldecode(): Passing null to parameter #1 ($string) of type string is deprecated in /home/lukas/public_html/matomophp8/plugins/Referrers/Columns/Base.php on line 313
    PHP Deprecated: urldecode(): Passing null to parameter #1 ($string) of type string is deprecated in /home/lukas/public_html/matomophp8/plugins/Referrers/SearchEngine.php on line 269

to be updated...

Powered by GitHub Issue Mirror