[pmwiki-users] New warnings with php 8.1.2

Petko Yotov 5ko at 5ko.fr
Wed Jan 26 08:29:01 PST 2022

Absolutely, there will be a version 2.3.2 with corrections.

Thanks for your report. I have PHP 8.1.2 on Ubuntu but for some reason 
it didn't show this warning even with error_reporting(E_ALL), 
display_errors and track_errors enabled.

Anyway, I know what causes this, and I have fixed if for PmWiki 2.3.2, 
due in a few days.

This precise warning is indeed caused by a change in PHP where 
previously it treated undefined variables or null as an empty string, 
now it complains that these are undefined. The "@" before the variable 
that previously suppressed the warnings is no longer enough.

The fix I use is to wrap the possibly undefined variable with strval(), 
it makes it behave like it did before.

You can get the pre-release, or even only the files that changed since 
2.3.1, from the top of the page Changelog:


Please test it and let me know if you encounter other problems.


PmWeekly Blog  :  http://www.pmwiki.org/News
If you upgrade :  http://www.pmwiki.org/Upgrades

On 26/01/2022 16:43, Hans-Jürgen Godau wrote:
> Today I got a number of deprecated error messages in my pmwiki after
> setting up php to version 8.1.2 on arch linux. There seem to be new
> warnings in case of unset parameters to preg_repalce, strlen or
> strncmp.
> That happens for examplin pmwiki.php:
> Passing null to parameter #3 ($subject) of type array|string is
> deprecated in pmwiki.php on line 75
> and also in some skin/cookbook scripts.
> Will there be a Version 2.3.2 with corrections?

More information about the pmwiki-users mailing list