3v4l.org

run code in 300+ PHP versions simultaneously
<?php function convert($n) { $n = (0 + str_replace(",", "", $n)); if (!is_numeric($n)) return false; if ($n > 1000000000000) return round(($n / 1000000000000) , 1) . 'T'; else if ($n > 1000000000) return round(($n / 1000000000) , 1) . 'B'; else if ($n > 1000000) return round(($n / 1000000) , 1) . 'M'; else if ($n > 1000) return round(($n / 1000) , 1) . 'K'; return number_format($n); } $n = convert('35,578,926'); echo $n; // 35.5M
Output for git.master, git.master_jit, rfc.property-hooks
35.6M

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:
166.76 ms | 405 KiB | 5 Q