3v4l.org

run code in 300+ PHP versions simultaneously
<?php function infVal($n, $prec = 3) { $size = preg_replace('/[^0-9]/', '', $n); $sizes = array("", "K", "M"); if ($size == 0) { return('n/a'); } return floor($size/pow(1000, ($i = floor(log($size, 1000))))) . $sizes[$i]; } var_dump( infVal(999), infVal(999999), infVal(1000000) );
Output for git.master, git.master_jit, rfc.property-hooks
string(3) "999" string(4) "999K" string(2) "1M"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
50.69 ms | 401 KiB | 8 Q