3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = 0x40; var_dump($a); // 64 var_dump(base_convert($a, 16, 2)); // But 64hex == 1100100 or 296 b/c passing effectively 64 in base 16 to convert to base 2 var_dump(base_convert(40, 16, 2)); // 64 b/c 40 in base 16 == 64 decimal == 1000000 or 2 ** 6
Output for 4.3.0 - 5.0.5, 5.1.1 - 7.1.0
int(64) string(7) "1100100" string(7) "1000000"
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/09aEo on line 5
Process exited with code 255.