3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $bit = 5.99999999999999; echo("1 << 6 = "); echo(1 << 6); echo("\n"); echo("\$bit = "); echo($bit); echo("\n"); echo("1 << \$bit = "); echo(1 << $bit); echo("\n"); echo("gettype(6) = "); echo gettype(6); echo("\n"); echo("gettype(log(64,2)) = "); echo gettype(log(64,2)); echo("\n"); echo("1 << round(\$bit) = "); echo(1 << round($bit));
Output for 4.3.0 - 5.6.30, hhvm-3.18.4 - 3.21.0, 7.0.0 - 7.3.0beta1
1 << 6 = 64 $bit = 6 1 << $bit = 32 gettype(6) = integer gettype(log(64,2)) = double 1 << round($bit) = 64