3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php return_bytes("8M"); function return_bytes($val) { $val = trim($val); $last = $val{strlen($val)-1}; switch($last) { case 'k': case 'K': return (int) $val * 1024; break; case 'm': case 'M': return (int) $val * 1048576; break; default: return $val; } } ?>
Output for 4.3.0 - 7.1.0