3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = INF; $n = pow(2,64); var_dump( $a/$n ); // floating point div with non-zero value echo $a - ($n * (int) ($a/$n) ),"\n"; // INF but s/b NAN echo fmod(INF,pow(2,64)),"\n"; // NAN correct! echo INF % pow(2,64); // integer div b/c % so pow(2,64) becomes 0
based on jMSQT
Output for 7.0.0 - 7.2.0
float(INF) INF NAN Fatal error: Uncaught DivisionByZeroError: Modulo by zero in /in/2ZjTO:12 Stack trace: #0 {main} thrown in /in/2ZjTO on line 12
Process exited with code 255.
Output for 5.3.20 - 5.6.21
float(INF) INF NAN Warning: Division by zero in /in/2ZjTO on line 12