PHP Warning: Division by zero

This forum covers all minor versions of PHP 7
Post Reply
User avatar
Administrator
Site Admin
Posts: 1725
Joined: Thu Mar 22, 2018 10:19 am

PHP Warning: Division by zero

Post by Administrator » Tue Sep 18, 2018 2:46 pm

This error is pretty self explanatory,

Code: Select all

$a = 0;
$b = 1;

$c = $b / $a; /* This would cause the error */
Bad Programming Style you could use @

Code: Select all

@$c = $b / $a; /* This error would be suppressed  */
or check with an if preferred method

Post Reply