fork download
  1. <?php
  2. $row = ['p1' => 0, 'p2' => 0];
  3. try {
  4. $perent = round(100.0*($row['p2']/$row['p1']-1));
  5. } catch(Exception $e) {
  6. echo 'Caught exception: ', $e->getMessage(), "\n";
  7. }
  8.  
Success #stdin #stdout #stderr 0.01s 20568KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Warning:  Division by zero in /home/WghHbN/prog.php on line 4