3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo 'post_max_size in bytes = ' .return_byte(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; } } echo 'post_max_size in bytes = ' .return_byte('8M'); ?>
Output for 5.4.0 - 5.4.21
Parse error: syntax error, unexpected 'M' (T_STRING) in /in/3ejFk on line 2
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_STRING in /in/3ejFk on line 2
Process exited with code 255.

preferences:
178.06 ms | 1395 KiB | 57 Q