3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $msb = -1 * pow(2,63); for ($i=62; $i >= 0; $i--) { $result = pow(2,$i); $msb += $result; echo $msb,'\n'; } echo '<p>***',$msb,'****</p>';
Output for 4.3.6 - 5.2.1, 5.2.7 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
-4.6116860184274E+18\n-2.3058430092137E+18\n-1.1529215046068E+18\n-5.7646075230342E+17\n-2.8823037615171E+17\n-1.4411518807586E+17\n-7.2057594037928E+16\n-3.6028797018964E+16\n-1.8014398509482E+16\n-9.007199254741E+15\n-4.5035996273705E+15\n-2.2517998136852E+15\n-1.1258999068426E+15\n-5.6294995342131E+14\n-2.8147497671066E+14\n-1.4073748835533E+14\n-70368744177664\n-35184372088832\n-17592186044416\n-8796093022208\n-4398046511104\n-2199023255552\n-1099511627776\n-549755813888\n-274877906944\n-137438953472\n-68719476736\n-34359738368\n-17179869184\n-8589934592\n-4294967296\n-2147483648\n-1073741824\n-536870912\n-268435456\n-134217728\n-67108864\n-33554432\n-16777216\n-8388608\n-4194304\n-2097152\n-1048576\n-524288\n-262144\n-131072\n-65536\n-32768\n-16384\n-8192\n-4096\n-2048\n-1024\n-512\n-256\n-128\n-64\n-32\n-16\n-8\n-4\n-2\n-1\n<p>***-1****</p>
Output for 5.2.2 - 5.2.6
-4.6116860184274E+18\n-2.3058430092137E+18\n-1.1529215046068E+18\n-576460752303420000\n-288230376151710000\n-144115188075860000\n-72057594037928000\n-36028797018964000\n-18014398509482000\n-9007199254741000\n-4503599627370500\n-2251799813685200\n-1125899906842600\n-562949953421310\n-281474976710660\n-140737488355330\n-70368744177664\n-35184372088832\n-17592186044416\n-8796093022208\n-4398046511104\n-2199023255552\n-1099511627776\n-549755813888\n-274877906944\n-137438953472\n-68719476736\n-34359738368\n-17179869184\n-8589934592\n-4294967296\n-2147483648\n-1073741824\n-536870912\n-268435456\n-134217728\n-67108864\n-33554432\n-16777216\n-8388608\n-4194304\n-2097152\n-1048576\n-524288\n-262144\n-131072\n-65536\n-32768\n-16384\n-8192\n-4096\n-2048\n-1024\n-512\n-256\n-128\n-64\n-32\n-16\n-8\n-4\n-2\n-1\n<p>***-1****</p>
Output for 4.3.0 - 4.3.1, 4.3.5
-4611686018427387904\n-2305843009213693952\n-1152921504606846976\n-576460752303423488\n-288230376151711744\n-144115188075855872\n-72057594037927936\n-36028797018963968\n-18014398509481984\n-9007199254740992\n-4503599627370496\n-2251799813685248\n-1125899906842624\n-562949953421312\n-281474976710656\n-140737488355328\n-70368744177664\n-35184372088832\n-17592186044416\n-8796093022208\n-4398046511104\n-2199023255552\n-1099511627776\n-549755813888\n-274877906944\n-137438953472\n-68719476736\n-34359738368\n-17179869184\n-8589934592\n-4294967296\n-2147483648\n-1073741824\n-536870912\n-268435456\n-134217728\n-67108864\n-33554432\n-16777216\n-8388608\n-4194304\n-2097152\n-1048576\n-524288\n-262144\n-131072\n-65536\n-32768\n-16384\n-8192\n-4096\n-2048\n-1024\n-512\n-256\n-128\n-64\n-32\n-16\n-8\n-4\n-2\n-1\n<p>***-1****</p>
Output for 4.3.2 - 4.3.4
1.3835058055282E+19\n1.6140901064496E+19\n1.7293822569103E+19\n1.7870283321406E+19\n1.8158513697558E+19\n1.8302628885634E+19\n1.8374686479672E+19\n1.8410715276691E+19\n1.84287296752E+19\n1.8437736874455E+19\n1.8442240474082E+19\n1.8444492273896E+19\n1.8445618173803E+19\n1.8446181123756E+19\n1.8446462598733E+19\n1.8446603336221E+19\n1.8446673704965E+19\n1.8446708889337E+19\n1.8446726481524E+19\n1.8446735277617E+19\n1.8446739675663E+19\n1.8446741874686E+19\n1.8446742974198E+19\n1.8446743523954E+19\n1.8446743798832E+19\n1.8446743936271E+19\n1.844674400499E+19\n1.844674403935E+19\n1.844674405653E+19\n1.844674406512E+19\n1.8446744069415E+19\n1.8446744071562E+19\n1.8446744072636E+19\n1.8446744073173E+19\n1.8446744073441E+19\n1.8446744073575E+19\n1.8446744073642E+19\n1.8446744073676E+19\n1.8446744073693E+19\n1.8446744073701E+19\n1.8446744073705E+19\n1.8446744073707E+19\n1.8446744073709E+19\n1.8446744073709E+19\n1.8446744073709E+19\n1.8446744073709E+19\n1.8446744073709E+19\n1.844674407371E+19\n1.844674407371E+19\n1.844674407371E+19\n1.844674407371E+19\n1.844674407371E+19\n1.844674407371E+19\n1.844674407371E+19\n1.844674407371E+19\n1.844674407371E+19\n1.844674407371E+19\n1.844674407371E+19\n1.844674407371E+19\n1.844674407371E+19\n1.844674407371E+19\n1.844674407371E+19\n1.844674407371E+19\n<p>***1.844674407371E+19****</p>