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, $base, $newbase); echo "new val is $newval"; }
Output for 5.5.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: base in /in/7DjGc on line 10 Warning: base_convert(): Invalid `from base' (0) in /in/7DjGc on line 10 new val is
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: base in /in/7DjGc on line 10 Warning: Invalid argument: Invalid frombase: 0 in /in/7DjGc on line 10 new val is
Output for 5.2.3 - 5.4.45
Warning: base_convert(): Invalid `from base' (0) in /in/7DjGc on line 10 new val is
Output for 4.4.3 - 5.2.2
<br /> <b>Warning</b>: base_convert() [<a href='function.base-convert'>function.base-convert</a>]: Invalid `from base' (0) in <b>/in/7DjGc</b> on line <b>10</b><br /> new val is
Output for 4.3.2 - 4.4.2
<br /> <b>Warning</b>: base_convert(): Invalid `from base' (0) in <b>/in/7DjGc</b> on line <b>10</b><br /> new val is
Output for 4.3.0 - 4.3.1
<br /> <b>Warning</b>: base_convert() [<a href='http://www.php.net/function.base-convert'>function.base-convert</a>]: Invalid `from base' (0) in <b>/in/7DjGc</b> on line <b>10</b><br /> new val is