Hi,
I just happend the check Station Reports and Station Graphs are both showing errors, the common demominator is the scripts pull data from WU.
Anyone else having a problem with invalid data downloaded effecting their scripts?
Ian
Good morning,
The errors are "warnings" so that programmers can adapt their code. You are probably using PHP 7.1.x .
Up until PHP release 7 the language used "loosely" typing where the type of a variable changed based on the instructions accessing the variable.
A string could be added to an integer and the result could be a string or an integer, just as you wanted.
With PHP 7 a more robust "typing" is requested, hence the warnings.
Normally in a production environment the error reporting is switched off so these messages would not be displayed. It seems error reporting is default on for your site.
===
"Invalid" or empty or non-existent data cause these errors, which is normal as not every day of a year you were or are uploading data to WU. The scripts cope with those values correctly, so the resulting tables and values are correct. The warnings could have been avaided, sorry for that
===
script wsreports/wsReportsDaily.php line 136 is now
$value = 1.0*$arrResults[$i][$k];
change to
$value = 1.0 * (float) $arrResults[$i][$k];
===
script wsreports/wsReportsSum.php line 97 is now
$value = 1.0*$arrResults[$k];
change to
$value = 1.0 * (float) $arrResults[$k];
===
Switching off the error reporting is also advisable. You can always manually switch it on by adding ?debug to the url
script wsreports/startReports.php line 1 is now
<?php
change to
<?php ini_set('display_errors', 0); error_reporting(0);
Wim