Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8 issues Fatal error: Uncaught DivisionByZeroError #1

Open
Jimmi08 opened this issue Aug 17, 2021 · 0 comments
Open

PHP 8 issues Fatal error: Uncaught DivisionByZeroError #1

Jimmi08 opened this issue Aug 17, 2021 · 0 comments

Comments

@Jimmi08
Copy link

Jimmi08 commented Aug 17, 2021

Fatal error: Uncaught DivisionByZeroError: Division by zero in ***\e107_plugins\log\stats.php:1820 Stack trace: #0 ***\e107_plugins\log\stats.php(212): siteStats->renderDaily() #1 ***\index.php(69): include_once('C:\\xampp8.0\\htd...') #2 {main} thrown in ***\e107_plugins\log\stats.php on line 1820

Maybe it is related just to PHP 8 or it is because first installation (no data available)

there is this code:

foreach($dayarray as $date => $total) 
		{
			if (!isset($total['daytotal'])) $total['daytotal'] = 0;
			list($year, $month, $day) = explode("-", $date);
			$date = strftime ("%A, %B %d", mktime (0,0,0,$month,$day,$year));
			$barWidth = round(($total['daytotal']/$ttotal) * 100, 2);
			$text .= "<tr>
			<td class='forumheader3' style='width: 30%;'>$date</td>
			<td class='forumheader3' style='width: 70%;'>".$this -> bar($barWidth, $total['daytotal'])."</td>
			</tr>\n";
		}

and
Array

(
    [2021-08-17] => Array
        (
        )

)

var_dump($ttotal); - NULL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant