3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $val = 2; $fbase = 10; $tbase = 16; $newbase = 16; if (strcmp($val, base_convert($val, $fbase, $tbase))) { echo "$val isn't purely in base $tbase"; } else { $newval = base_convert($val, $fbase, $newbase); echo "new val is $newval"; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
new val is 2