3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!function_exists('nice_number')) { function nice_number($n) { // first strip any formatting; $n = (0 + str_replace(",", "", $n)); // is this a number? if (!is_numeric($n)) return false; // now filter it; $str = ''; if ($n > 1000000000000) { $str = round(($n / 1000000000000), 0) . ' tn '; $str .= $n % 1000000000000 > 0 ? nice_number($n % 1000000000000); : ''; return $str; } else if ($n > 1000000000) { $str = round(($n / 1000000000), 0) . ' bn '; $str .= $n % 1000000000 > 0 ? nice_number($n % 1000000000); : ''; return $str; } else if ($n > 1000000) { $str = round(($n / 1000000), 0) . ' mn '; $str .= $n % 1000000 > 0 ? nice_number($n % 1000000); : ''; return $str; } else if ($n > 1000) return round(($n / 1000), 20) . ' K '; return number_format($n); } } echo nice_number(300000000);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.270.0270.03019.08
5.4.260.0200.04318.85
5.4.250.0230.03319.07
5.4.240.0230.06718.84
5.4.230.0330.03319.11
5.4.220.0230.04018.94
5.4.210.0230.06019.30
5.4.200.0300.05319.13
5.4.190.0170.04019.21
5.4.180.0330.03018.98
5.4.170.0200.03718.86
5.4.160.0330.03018.89
5.4.150.0370.04719.20
5.4.140.0330.06316.50
5.4.130.0270.06316.50
5.4.120.0300.06316.38
5.4.110.0200.03716.59
5.4.100.0130.04016.41
5.4.90.0230.03716.19
5.4.80.0130.04016.56
5.4.70.0130.04716.55
5.4.60.0170.04016.49
5.4.50.0200.03716.53
5.4.40.0200.03716.16
5.4.30.0270.02716.34
5.4.20.0200.03316.24
5.4.10.0230.03016.25
5.4.00.0170.03715.90
5.3.280.0170.07014.61
5.3.270.0230.04014.77
5.3.260.0170.04014.54
5.3.250.0230.04014.61
5.3.240.0230.03714.82
5.3.230.0230.05714.60
5.3.220.0230.06014.73
5.3.210.0170.04014.65
5.3.200.0300.03014.56
5.3.190.0200.03714.47
5.3.180.0270.03714.54
5.3.170.0130.04314.72
5.3.160.0200.04314.61
5.3.150.0200.03714.79
5.3.140.0230.03014.56
5.3.130.0270.04014.63
5.3.120.0130.04314.66
5.3.110.0170.04014.52
5.3.100.0230.03014.09
5.3.90.0170.04313.94
5.3.80.0100.04314.02
5.3.70.0170.03714.11
5.3.60.0200.03713.98
5.3.50.0170.03714.07
5.3.40.0200.03313.97
5.3.30.0230.05713.96
5.3.20.0270.02713.59
5.3.10.0230.03313.74
5.3.00.0200.04313.57

preferences:
138.18 ms | 1394 KiB | 7 Q