3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function prettynum($num, $dollar = null) { global $mtgdb; $out = strrev((string) preg_replace('/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev($num))); if($dollar && is_numeric($num)) { $out = "$" . $out; } return $out; } echo prettynum(123456),"<br />"; echo prettynum(123456, 1),"<br />"; echo number_format(123456);

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.60.0220.00816.57
7.2.00.0120.00619.60
7.1.200.0030.00915.94
7.1.100.0040.01118.45
7.1.70.0060.00317.51
7.1.60.0090.01519.70
7.1.50.0070.00417.19
7.1.00.0000.08022.34
7.0.200.0240.00316.55
7.0.140.0100.07022.11
7.0.60.0030.08020.01
7.0.50.0000.08717.89
7.0.40.0100.05020.22
7.0.30.0530.04720.05
7.0.20.0200.04720.25
7.0.10.0200.05020.16
7.0.00.0100.09020.22
5.6.280.0070.07021.13
5.6.210.0100.07720.51
5.6.200.0030.08018.19
5.6.190.0170.06320.61
5.6.180.3330.04020.59
5.6.170.0270.05320.66
5.6.160.0100.05320.44
5.6.150.0070.08318.22
5.6.140.0130.08018.28
5.6.130.0130.03318.23
5.6.120.0200.07320.90
5.6.110.0000.07720.99
5.6.100.0100.08020.98
5.6.90.0170.07320.97
5.6.80.0100.05020.41
5.6.70.0300.07320.40
5.5.350.0200.08020.42
5.5.340.0130.07017.96
5.5.330.0070.04020.43
5.5.320.0500.06720.28
5.5.310.0270.05020.30
5.5.300.0030.05718.04
5.5.290.0030.08318.08
5.5.280.0070.06020.73
5.5.270.0030.08720.89
5.5.260.0100.07720.97
5.5.250.0100.08320.58
5.5.240.0130.07720.16
5.4.450.0370.06019.56
5.4.440.0230.07719.20
5.4.430.0270.07019.19
5.4.420.0270.05019.69
5.4.410.0300.06019.45
5.4.400.0230.07019.09
5.4.390.0330.04318.95
5.4.380.0270.06318.87
5.4.370.0230.05019.05
5.4.360.0300.02718.95
5.4.350.0170.05019.09
5.4.340.0230.05018.95
5.4.320.0230.07719.14
5.4.310.0200.05019.22
5.4.300.0270.07319.05
5.4.290.0170.06019.08
5.4.280.0300.06019.12
5.4.270.0270.05719.05
5.4.260.0230.03719.37
5.4.250.0170.05319.22
5.4.240.0230.04719.23
5.4.230.0270.07019.05
5.4.220.0300.04019.23
5.4.210.0200.05019.14
5.4.200.0300.07019.12
5.4.190.0230.04019.22
5.4.180.0300.02719.23
5.4.170.0270.03718.85
5.4.160.0200.04019.19
5.4.150.0330.06018.84
5.4.140.0330.06716.43
5.4.130.0230.06716.50
5.4.120.0370.03316.46
5.4.110.0270.04316.33
5.4.100.0300.06716.46
5.4.90.0200.04716.67
5.4.80.0200.03716.68
5.4.70.0270.03016.44
5.4.60.0200.03716.56
5.4.50.0100.05016.60
5.4.40.0130.03716.57
5.4.30.0130.03716.57
5.4.20.0100.04016.47
5.4.10.0170.03716.43
5.4.00.0100.04016.22
5.3.290.0100.04316.22
5.3.280.0130.04016.22
5.3.270.0230.03316.22
5.3.260.0200.03316.22
5.3.250.0330.02316.22
5.3.240.0200.03716.22
5.3.230.0130.04716.22
5.3.220.0070.04716.22
5.3.210.0100.04316.22
5.3.200.0200.03316.22
5.3.190.0130.04016.22
5.3.180.0230.02716.22
5.3.170.0170.03716.22
5.3.160.0130.04016.22
5.3.150.0200.04316.22
5.3.140.0100.04316.22
5.3.130.0200.03316.22
5.3.120.0200.03316.22
5.3.110.0100.04316.22
5.3.100.0230.03316.22
5.3.90.0170.03316.22
5.3.80.0200.03016.22
5.3.70.0130.03716.22
5.3.60.0170.03316.22
5.3.50.0100.04016.22
5.3.40.0270.02716.22
5.3.30.0170.03316.22
5.3.20.0170.03316.22
5.3.10.0070.05316.22
5.3.00.0230.03316.22
5.2.170.0070.03716.22
5.2.160.0130.02716.22
5.2.150.0100.03016.22
5.2.140.0100.03316.22
5.2.130.0170.02316.22
5.2.120.0170.02316.22
5.2.110.0230.04316.22
5.2.100.0170.03316.22
5.2.90.0130.02716.22
5.2.80.0170.03016.22
5.2.70.0130.02716.22
5.2.60.0130.02716.22
5.2.50.0100.03016.22
5.2.40.0100.03316.22
5.2.30.0100.02716.22
5.2.20.0100.03016.22
5.2.10.0070.03016.22
5.2.00.0100.02716.22
5.1.60.0100.02316.22
5.1.50.0170.01716.22
5.1.40.0030.03016.22
5.1.30.0100.02716.22
5.1.20.0170.02016.22
5.1.10.0100.02316.22
5.1.00.0070.02716.22
5.0.50.0030.02016.22
5.0.40.0070.02016.22
5.0.30.0070.04016.22
5.0.20.0070.01716.22
5.0.10.0100.01716.22
5.0.00.0030.03016.22
4.4.90.0070.01716.22
4.4.80.0070.01316.22
4.4.70.0070.01316.22
4.4.60.0070.01316.22
4.4.50.0070.01316.22
4.4.40.0030.03016.22
4.4.30.0030.01716.22
4.4.20.0100.01016.22
4.4.10.0070.01316.22
4.4.00.0070.02316.22
4.3.110.0030.01716.22
4.3.100.0100.01016.22
4.3.90.0070.01316.22
4.3.80.0070.02316.22
4.3.70.0070.01316.22
4.3.60.0030.01716.22
4.3.50.0100.01316.22
4.3.40.0030.03716.22
4.3.30.0000.02016.22
4.3.20.0000.02316.22
4.3.10.0030.02016.22
4.3.00.0030.03716.22