3v4l.org

run code in 300+ PHP versions simultaneously
<? $count = 1000000; function t($a, $b) { return ($a + $b) * ($a - $b); } class test { public static function staticTest($a, $b) { return ($a + $b) * ($a - $b); } } $time = microtime(true); $i = 0; $a = 1; $b = 1; while ($i++ < $count) { $res = ($a + $b) * ($a - $b); $a = $a + 2; $b = $b + 1; } echo '$a = $a + 1: ', "\t\t\t", (microtime(true) - $time), PHP_EOL; $time = microtime(true); $i = 0; $a = 1; $b = 1; while ($i++ < $count) { $a = t($a, $b); $a = $a + 2; $b = $b + 1; } echo '$a = t($a): ', "\t\t\t", (microtime(true) - $time), PHP_EOL; $time = microtime(true); $i = 0; $a = 1; $b = 1; while ($i++ < $count) { test::staticTest($a, $b); $a = $a + 2; $b = $b + 1; } echo 'test::staticTest($a): ', "\t\t", (microtime(true) - $time), PHP_EOL;

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)
8.2.110.0070.00321.06
8.2.100.0000.01117.59
8.2.90.0000.00817.91
8.2.80.0060.00318.03
8.2.70.0080.00017.63
8.2.60.0040.00417.50
8.2.50.0030.00618.07
8.2.40.0000.00818.03
8.2.30.0050.00217.85
8.2.20.0040.00417.60
8.2.10.0050.00217.88
8.2.00.0000.00818.17
8.1.240.0080.00320.66
8.1.230.0000.01120.91
8.1.220.0080.00017.74
8.1.210.0030.00518.78
8.1.200.0000.00817.10
8.1.190.0040.00416.86
8.1.180.0050.00318.10
8.1.170.0030.00620.37
8.1.160.0000.00721.89
8.1.150.0000.00718.67
8.1.140.0080.00017.22
8.1.130.0040.00417.81
8.1.120.0050.00217.40
8.1.110.0030.00517.30
8.1.100.0070.00017.23
8.1.90.0000.00817.31
8.1.80.0040.00417.38
8.1.70.0000.00717.21
8.1.60.0060.00317.48
8.1.50.0050.00217.36
8.1.40.0060.00317.41
8.1.30.0040.00417.46
8.1.20.0050.00217.45
8.1.10.0040.00417.42
8.1.00.0000.00717.39
8.0.300.0000.00819.90
8.0.290.0070.00016.63
8.0.280.0000.00718.30
8.0.270.0070.00017.19
8.0.260.0070.00017.17
8.0.250.0030.00316.71
8.0.240.0060.00316.81
8.0.230.0030.00316.73
8.0.220.0060.00316.66
8.0.210.0070.00016.67
8.0.200.0040.00416.83
8.0.190.0000.00816.84
8.0.180.0040.00416.66
8.0.170.0040.00416.64
8.0.160.0030.00316.79
8.0.150.0040.00416.76
8.0.140.0030.00316.63
8.0.130.0000.13613.34
8.0.120.0040.00416.74
8.0.110.0040.00416.78
8.0.100.0070.00016.87
8.0.90.0040.00416.65
8.0.80.0070.01116.80
8.0.70.0000.00716.64
8.0.60.0040.00416.76
8.0.50.0000.00716.79
8.0.30.0150.00916.97
8.0.20.0130.00617.40
8.0.10.0040.00416.71
8.0.00.0110.00816.66
7.4.330.0030.09315.03
7.4.320.0000.00616.27
7.4.300.0040.00416.50
7.4.290.0030.00316.39
7.4.280.0090.00016.37
7.4.270.0030.00316.42
7.4.260.0070.00016.37
7.4.250.0000.00716.19
7.4.240.0040.00416.39
7.4.230.0000.00716.45
7.4.220.0130.00616.41
7.4.210.0070.00716.32
7.4.200.0000.00816.45
7.4.160.0070.01016.35
7.4.150.0120.00617.40
7.4.140.0090.00917.86
7.4.130.0180.00216.30
7.4.120.0120.00816.29
7.4.110.0090.00916.41
7.4.100.0060.01016.56
7.4.90.0090.00916.44
7.4.80.0090.00619.39
7.4.70.0070.01316.46
7.4.60.0050.01816.47
7.4.50.0070.00016.53
7.4.40.0030.01316.20
7.4.30.0130.00916.40
7.4.00.0110.00414.49
7.3.330.0070.14813.13
7.3.320.0040.16713.29
7.3.310.0070.00016.00
7.3.300.0000.00616.15
7.3.290.0070.00916.17
7.3.280.0080.00816.15
7.3.270.0040.01317.40
7.3.260.0180.00016.56
7.3.250.0080.01016.16
7.3.240.0070.01016.38
7.3.230.0120.00616.39
7.3.210.0150.00616.17
7.3.200.0060.01319.39
7.3.190.0000.01716.20
7.3.180.0130.00316.37
7.3.170.0130.00616.27
7.3.160.0120.00416.18
7.3.120.0110.00214.40
7.3.110.0110.00714.52
7.3.100.0070.01014.42
7.3.90.0030.01014.44
7.3.80.0000.00914.65
7.3.70.0060.00914.61
7.3.60.0090.00314.53
7.3.50.0090.00014.50
7.3.40.0070.01114.80
7.3.30.0100.00714.73
7.3.20.0090.00616.53
7.3.10.0100.10816.54
7.3.00.0080.10216.39
7.2.330.0030.01516.50
7.2.320.0090.01316.44
7.2.310.0030.01316.21
7.2.300.0070.01016.38
7.2.290.0060.01216.38
7.2.250.0100.01014.97
7.2.240.0000.01814.71
7.2.230.0060.01014.83
7.2.220.0070.00714.93
7.2.210.0070.01114.79
7.2.200.0100.00314.69
7.2.190.0000.00914.88
7.2.180.0070.00314.84
7.2.170.0070.01114.96
7.2.130.0130.22216.36
7.2.120.0220.21216.34
7.2.110.0320.19716.84
7.2.100.0030.20916.64
7.2.90.0100.20816.77
7.2.80.0090.20316.75
7.2.70.0000.21416.91
7.2.60.0070.21216.17
7.2.50.0130.21316.55
7.2.40.0170.21316.80
7.2.30.0050.23916.65
7.2.20.0120.22816.54
7.2.10.0130.22316.48
7.2.00.0090.20416.71
7.1.330.0100.00715.73
7.1.320.0130.00315.60
7.1.310.0030.00715.80
7.1.300.0090.00315.57
7.1.290.0040.01115.70
7.1.280.0120.00315.70
7.1.270.0070.01015.73
7.1.260.0060.00615.64
7.1.250.0070.42615.63
7.1.70.0460.11517.38
7.1.60.0100.11719.50
7.1.50.0100.18417.02
7.1.00.0070.29022.43
7.0.200.0190.13514.78
7.0.140.0030.24722.04
7.0.60.0070.21319.98
7.0.50.0000.20017.86
7.0.40.0130.20720.40
7.0.30.0300.21320.09
7.0.20.0200.19020.16
7.0.10.0030.17320.25
7.0.00.0030.18320.16
5.6.280.0030.50021.16
5.6.210.0070.42720.63
5.6.200.0030.52018.25
5.6.190.0070.39320.50
5.6.180.0330.37720.55
5.6.170.0230.41320.34
5.6.160.0100.48720.54
5.6.150.0030.44718.20
5.6.140.0070.43718.18
5.6.130.0100.47318.12
5.6.120.0070.42021.03
5.6.110.0030.45021.15
5.6.100.0100.50321.00
5.6.90.0100.48020.98
5.6.80.0170.47320.45
5.5.350.0270.43020.42
5.5.340.0100.47718.07
5.5.330.0030.42320.44
5.5.320.0230.41320.32
5.5.310.0330.47320.27
5.5.300.0100.46717.98
5.5.290.0130.47717.98
5.5.280.0030.46720.66
5.5.270.0130.48320.85
5.5.260.0130.47320.77
5.5.250.0130.41020.79
5.5.240.0000.47320.17
5.4.450.3830.35719.29
5.4.440.0030.34319.26
5.4.430.0370.34319.28
5.4.420.3230.33719.55
5.4.410.4100.35719.44
5.4.400.3900.35319.25
5.4.390.3700.37019.22
5.4.380.4570.45319.22
5.4.370.3900.36318.93
5.4.360.4370.34319.10
5.4.350.3630.36019.15
5.4.340.4100.35719.07
5.4.320.0170.40319.22
5.4.310.3470.35319.18
5.4.300.3730.35719.16
5.4.290.4530.34719.21
5.4.280.4800.34319.22
5.4.270.4470.34018.92
5.4.260.0030.41319.16
5.4.250.0100.35718.91
5.4.240.3900.34019.05
5.4.230.4530.34719.12
5.4.220.3870.34019.21
5.4.210.3730.33718.94
5.4.200.3830.35019.12
5.4.190.3570.35019.23
5.4.180.4030.36319.18
5.4.170.3770.34019.21
5.4.160.3730.33319.04
5.4.150.3670.39319.02
5.4.140.3500.34716.50
5.4.130.3170.34316.40
5.4.120.3500.34716.54
5.4.110.3800.33316.40
5.4.100.3900.34016.50
5.4.90.4070.34316.68
5.4.80.4600.34716.38
5.4.70.3970.34716.55
5.4.60.3970.35716.40
5.4.50.4130.35016.45
5.4.40.4570.35316.41
5.4.30.3930.35016.47
5.4.20.4470.34016.47
5.4.10.3830.35316.45
5.4.00.4200.52016.01
5.3.290.0130.07314.59
5.3.280.3970.03014.49
5.3.270.3970.03314.57
5.3.260.3670.03014.58
5.3.250.3970.04014.52
5.3.240.3670.04014.62
5.3.230.2830.04014.47
5.3.220.3670.03314.58
5.3.210.3370.04014.48
5.3.200.4130.02714.65
5.3.190.3870.03314.49
5.3.180.4500.03714.51
5.3.170.4030.03714.55
5.3.160.3970.03714.50
5.3.150.4000.03714.53
5.3.140.4670.03714.48
5.3.130.5930.04314.48
5.3.120.4130.03314.47
5.3.110.3970.03714.35
5.3.100.3630.05714.02
5.3.90.4070.03313.80
5.3.80.3630.04013.96
5.3.70.3800.02713.93
5.3.60.3970.03713.98
5.3.50.3930.03313.76
5.3.40.3900.04013.91
5.3.30.3930.04313.72
5.3.20.4030.03713.78
5.3.10.3870.04013.62
5.3.00.4230.03713.56
5.2.170.3200.02311.13
5.2.160.3470.03311.09
5.2.150.3370.02711.04
5.2.140.3030.03311.12
5.2.130.2900.02711.09
5.2.120.3130.03310.99
5.2.110.3400.03011.08
5.2.100.4000.02310.98
5.2.90.3670.03011.02
5.2.80.2970.03311.24
5.2.70.3270.02711.06
5.2.60.3630.03010.94
5.2.50.3970.03010.90
5.2.40.3200.02710.91
5.2.30.2830.02710.88
5.2.20.3270.03011.04
5.2.10.2170.02710.71
5.2.00.2500.03010.61
5.1.60.2430.0239.83
5.1.50.2530.03010.00
5.1.40.3000.0209.98
5.1.30.3230.02310.48
5.1.20.3000.03710.23
5.1.10.2970.01710.21
5.1.00.2530.02710.07
5.0.50.1630.0238.54
5.0.40.1600.0308.37
5.0.30.1830.0238.19
5.0.20.1630.0178.16
5.0.10.1770.0178.06
5.0.00.0930.0308.17
4.4.90.1200.0176.23
4.4.80.1570.0176.23
4.4.70.1700.0175.80
4.4.60.1070.0175.81
4.4.50.1470.0135.84
4.4.40.1200.0275.78
4.4.30.1200.0175.83
4.4.20.1270.0135.95
4.4.10.1470.0175.95
4.4.00.1370.0275.83
4.3.110.1070.0205.75
4.3.100.1470.0135.70
4.3.90.2000.0135.77
4.3.80.0030.0475.82
4.3.70.0030.0135.77
4.3.60.0030.0275.77
4.3.50.0000.0235.70
4.3.40.0000.0275.75
4.3.30.0000.0335.70
4.3.20.0000.0335.70
4.3.10.0000.0275.70
4.3.00.0000.0375.70

preferences:
63.79 ms | 400 KiB | 5 Q