3v4l.org

run code in 300+ PHP versions simultaneously
<?php phpversion() >= "5.6.16" or die(); $two_pow_64 = pow(2,64); echo (int) INF,"\n"; echo (int) $two_pow_64,"\n"; echo ((int) INF) % 2, "\n"; echo ((int) INF) / ((int) $two_pow_64); try { echo intdiv( INF, $two_pow_64 ); } catch (Error $e) { echo $e->getMessage(),"\n"; } try { echo ( INF % $two_pow_64); } catch (Error $e) { echo $e->getMessage(),"\n"; }
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0 - 7.2.6
0 0 0 Warning: Division by zero in /in/0fuhr on line 9 NAN Warning: intdiv() expects parameter 1 to be integer, float given in /in/0fuhr on line 12 Modulo by zero
Output for 5.6.8 - 5.6.9, 5.6.16 - 5.6.28
-9223372036854775808 0 0 Warning: Division by zero in /in/0fuhr on line 9 Fatal error: Call to undefined function intdiv() in /in/0fuhr on line 12
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.10 - 5.6.15

preferences:
80.94 ms | 401 KiB | 47 Q