3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $bits32 = 32; $bits64 = 64; $N32 = 0xfffffffe; $N64 = 0xfffffffffffffffe; $result = -( pow(2, $bits32) - $N32 ); echo $result,"\n"; echo pow(2,$bits32) , "\n",$N32; $result = -( pow(2, $bits64) - $N64 ); echo "\n",$result,"\n"; echo pow(2,$bits64) - PHP_INT_MAX, "\n",$N64 - PHP_INT_MAX;
Output for 7.0.2 - 7.1.0
-2 4294967296 4294967294 -0 9.2233720368548E+18 9.2233720368548E+18
Output for 4.4.0 - 4.4.9, 5.0.5 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.1
-2 4294967296 4294967294 0 9.2233720368548E+18 9.2233720368548E+18
Output for 4.3.0 - 4.3.11, 5.0.0 - 5.0.4
-2 4294967296 4294967294 0 Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/KXhOv on line 14 1.844674407371E+19 Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/KXhOv on line 14 1.844674407371E+19