Hi Jenny,
You already answered one of my questions: you swtich between PHP8.0 (script working) and PHP8.1.x (not working). So that fits: the php deprecation is exactly introduced with 8.1.x as the PHP release notes announce.
As I am not willing to give up (yet), some more ideas:
After checking PHP manual again in more detail: my floor () solution was incorrect. Floor () does not convert float to integer but returns still float. Therefore also the floor () solution requires a typecast with (int) floor () and then we can stick also with (int) round ().
I suggest we stick with ONE of the modified code:
Code: Select all
if($display['showWindDirVerbose']){
$auto .= $langWindVerbose[ (int) (round(($avgbearing +11) / 22.5 % 16))];
$hybrid .= $langWindVerbose[ (int) (round(($avgbearing +11) / 22.5 % 16))];
} else {
$auto .= $langWindShort[ (int) (round(($avgbearing +11) / 22.5 % 16))];
$hybrid .= $langWindShort[ (int) (round(($avgbearing +11) / 22.5 % 16))];
}
Does this modified code work fine in php8.0 first, and then you switch to php 8.1 the message appears? Can you keep the modified code in your site (as it is working fine under php8)?
Are we sure that the modified code is active? Can you add some additional code line that shifts the line number or echos a comment, like:
Code: Select all
echo "<!-- modified-deprecated -->\n";
We could check that out, by using context menu in browser (right moude, view source) or ctrl-U (when using chrome).
I assume you just test with the standard curconditions.php functionality and not with admin modifier when it occurs.
So when modified code is really active the next idea is that it might be another code line that is causing the deprecated message and I am looking into the wrong place.
And last not least I could try to debug your code in my development area by installing a php 8.1 version (at least temporarily or in parallel).
For the last two ideas I would need the php8.1 error message(s) with exact line number when using the modified code and your modified code (the curconditions.php script should be enough). Are you willing to send me a zip (please change the following line but keep it, and keep the rest as it is when error message appears).