3v4l.org

run code in 300+ PHP versions simultaneously
<?php function benchmarkMemory(callable $function, $args=null) { $memory = memory_get_peak_usage(); $result = is_array($args)? call_user_func_array($function, $args): call_user_func_array($function); return ['memory' => memory_get_peak_usage() - $memory]; } var_dump(benchmarkMemory('str_repeat', ['test',1E4])); gc_collect_cycles(); var_dump(benchmarkMemory('str_repeat', ['test',1E3]));

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.3.60.0070.00716.63
8.3.50.0150.00521.21
8.3.40.0070.01118.72
8.3.30.0120.00318.67
8.3.20.0040.00420.34
8.3.10.0080.00023.45
8.3.00.0040.00423.48
8.2.180.0030.01616.50
8.2.170.0000.01522.96
8.2.160.0070.00722.25
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00017.63
8.2.110.0070.00422.29
8.2.100.0080.00317.91
8.2.90.0030.00522.10
8.2.80.0060.00319.54
8.2.70.0090.00017.50
8.2.60.0000.00818.04
8.2.50.0040.00418.10
8.2.40.0050.00321.10
8.2.30.0080.00019.86
8.2.20.0040.00417.64
8.2.10.0080.00018.03
8.2.00.0000.00718.07
8.1.280.0100.01025.92
8.1.270.0030.00720.33
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00622.54
8.1.230.0110.00020.86
8.1.220.0040.00417.74
8.1.210.0030.00620.63
8.1.200.0060.00317.35
8.1.190.0000.00917.22
8.1.180.0090.00018.10
8.1.170.0050.00318.52
8.1.160.0050.00222.00
8.1.150.0000.00718.80
8.1.140.0040.00417.49
8.1.130.0070.00017.75
8.1.120.0000.00717.40
8.1.110.0040.00417.35
8.1.100.0050.00217.41
8.1.90.0000.00717.32
8.1.80.0000.00717.31
8.1.70.0040.00417.47
8.1.60.0060.00317.71
8.1.50.0020.00517.63
8.1.40.0080.00017.34
8.1.30.0000.00817.77
8.1.20.0060.00317.68
8.1.10.0020.00517.59
8.1.00.0040.00417.41
8.0.300.0070.00020.04
8.0.290.0060.00316.58
8.0.280.0030.00318.43
8.0.270.0070.00017.29
8.0.260.0040.00417.29
8.0.250.0040.00416.90
8.0.240.0000.00717.00
8.0.230.0030.00316.91
8.0.220.0000.00716.94
8.0.210.0030.00316.85
8.0.200.0040.00417.00
8.0.190.0050.00316.96
8.0.180.0000.00716.95
8.0.170.0060.00316.88
8.0.160.0030.00616.89
8.0.150.0000.00816.81
8.0.140.0040.00416.90
8.0.130.0060.00013.43
8.0.120.0060.00316.86
8.0.110.0030.00616.92
8.0.100.0030.00516.98
8.0.90.0000.00716.82
8.0.80.0140.00616.97
8.0.70.0040.00416.89
8.0.60.0000.00716.80
8.0.50.0060.00316.97
8.0.30.0090.00617.03
8.0.20.0100.00817.40
8.0.10.0000.00717.11
8.0.00.0100.00716.73
7.4.330.0050.00015.22
7.4.320.0060.00016.41
7.4.300.0000.00616.50
7.4.290.0030.00316.41
7.4.280.0040.00416.53
7.4.270.0030.00316.54
7.4.260.0000.00716.50
7.4.250.0040.00416.53
7.4.240.0050.00316.52
7.4.230.0000.00716.66
7.4.220.0070.01016.71
7.4.210.0090.00716.59
7.4.200.0030.00316.76
7.4.160.0140.00916.71
7.4.150.0120.00917.40
7.4.140.0110.01117.86
7.4.130.0100.00716.44
7.4.120.0090.00916.57
7.4.110.0090.00916.55
7.4.100.0120.01216.43
7.4.90.0150.00316.57
7.4.80.0110.00919.39
7.4.70.0100.00616.53
7.4.60.0040.01216.40
7.4.50.0030.00616.59
7.4.40.0090.00916.67
7.4.30.0150.00316.30
7.4.00.0030.01014.84
7.3.330.0060.00013.21
7.3.320.0000.00613.19
7.3.310.0000.00716.34
7.3.300.0070.00016.39
7.3.290.0080.00016.25
7.3.280.0050.01316.34
7.3.270.0030.01417.40
7.3.260.0130.00916.70
7.3.250.0090.01216.55
7.3.240.0070.01116.65
7.3.230.0060.01216.39
7.3.210.0000.01616.54
7.3.200.0060.01116.48
7.3.190.0070.01016.45
7.3.180.0120.00316.66
7.3.170.0060.00916.45
7.3.160.0100.00716.63
7.2.330.0110.00516.85
7.2.320.0080.01116.41
7.2.310.0120.01016.66
7.2.300.0120.00816.55
7.2.290.0000.01616.80
7.2.60.0030.01016.80
7.2.00.0000.01419.48
7.1.200.0060.00615.86
7.1.100.0150.00018.00
7.1.70.0050.00216.97
7.1.60.0120.01219.12
7.1.50.0060.01916.43
7.1.00.0030.07722.57
7.0.200.0050.00216.59
7.0.60.0030.07020.04
7.0.50.0030.07017.93
7.0.40.0070.08720.23
7.0.30.0230.05720.35
7.0.20.0400.05020.25
7.0.10.0030.09020.33
7.0.00.0100.08020.18
5.6.280.0000.06721.09
5.6.210.0070.07720.47
5.6.200.0070.08318.19
5.6.190.0130.04320.42
5.6.180.0330.05020.43
5.6.170.0430.07720.52
5.6.160.0030.07320.42
5.6.150.0130.07018.18
5.6.140.0030.05718.18
5.6.130.0030.05718.20
5.6.120.0070.08721.20
5.6.110.0130.03721.09
5.6.100.0070.08321.12
5.6.90.0070.09021.07
5.6.80.0070.04320.54
5.5.350.0330.07020.47
5.5.340.0030.08717.98
5.5.330.0100.08020.21
5.5.320.0170.04020.36
5.5.310.0270.07720.24
5.5.300.0000.09018.05
5.5.290.0030.08717.95
5.5.280.0100.08020.65
5.5.270.0070.04020.83
5.5.260.0070.08020.73
5.5.250.0070.04020.61
5.5.240.0030.07320.24
5.4.450.0730.06319.59
5.4.440.0070.06719.38
5.4.430.0370.05719.16
5.4.420.0130.05719.47
5.4.410.0130.05319.31
5.4.400.0370.05718.98
5.4.390.0500.05018.99
5.4.380.0570.06019.26
5.4.370.0300.06719.13
5.4.360.0400.04719.23
5.4.350.0400.05018.98
5.4.340.0330.05319.12
5.4.320.0330.06019.05
5.4.310.0530.05718.98
5.4.300.0570.05319.28
5.4.290.0170.05319.16
5.4.280.0330.05319.01
5.4.270.0170.06319.14
5.4.260.0400.06318.83
5.4.250.0030.06319.37
5.4.240.0130.05319.12
5.4.230.0570.05719.00
5.4.220.0570.07019.14
5.4.210.0570.06319.25
5.4.200.0700.05016.88
5.4.190.0500.05319.00
5.4.180.0530.06019.18
5.4.170.0770.05319.18
5.4.160.0530.05319.18
5.4.150.0570.06319.13
5.4.140.0570.05316.55
5.4.130.0530.04316.38
5.4.120.0470.04716.52
5.4.110.0400.04316.58
5.4.100.0500.07016.39
5.4.90.0470.05716.58
5.4.80.0670.04016.61
5.4.70.0570.05716.47
5.4.60.0670.05016.56
5.4.50.0600.04016.75
5.4.40.0600.05316.57
5.4.30.0500.05316.57
5.4.20.0570.05016.55
5.4.10.0500.05316.32
5.4.00.0730.06316.09
5.3.290.0500.08014.75
5.3.280.0700.06314.51
5.3.270.0470.06314.50
5.3.260.0630.06714.57
5.3.250.0570.06014.66
5.3.240.0570.05714.62
5.3.230.0630.05314.62
5.3.220.0600.07014.43
5.3.210.0670.05014.43
5.3.200.0570.05714.54
5.3.190.0470.05314.48
5.3.180.0600.05314.43
5.3.170.0500.06314.58
5.3.160.0330.06014.48
5.3.150.0530.06014.58
5.3.140.0570.05314.39
5.3.130.0500.05314.78
5.3.120.0500.06014.46
5.3.110.0600.04714.57
5.3.100.0400.05714.01
5.3.90.0570.05014.08
5.3.80.0730.06014.04
5.3.70.0570.05314.07
5.3.60.0670.06013.90
5.3.50.0670.05013.97
5.3.40.0800.04713.97
5.3.30.0530.04713.81
5.3.20.0600.04713.74
5.3.10.0670.04713.88
5.3.00.0670.03713.55
5.2.170.0370.04711.30
5.2.160.0400.04311.10
5.2.150.0300.05311.07
5.2.140.0500.04011.10
5.2.130.0530.03011.11
5.2.120.0500.04011.11
5.2.110.0230.04311.10
5.2.100.0400.04011.25
5.2.90.0430.04011.16
5.2.80.0470.03711.00
5.2.70.0270.05311.24
5.2.60.0470.04310.91
5.2.50.0230.05310.96
5.2.40.0400.04311.05
5.2.30.0370.04010.98
5.2.20.0470.04010.88
5.2.10.0370.04010.87
5.2.00.0430.03710.72
5.1.60.0330.03310.08
5.1.50.0230.0439.92
5.1.40.0330.0339.90
5.1.30.0430.04010.27
5.1.20.0370.05010.36
5.1.10.0270.0439.96
5.1.00.0330.04010.09
5.0.50.0200.0308.63
5.0.40.0270.0278.39
5.0.30.0230.0538.23
5.0.20.0300.0278.14
5.0.10.0270.0378.23
5.0.00.0330.0378.19
4.4.90.0170.0306.26
4.4.80.0200.0276.26
4.4.70.0300.0176.26
4.4.60.0200.0236.26
4.4.50.0200.0176.26
4.4.40.0100.0406.26
4.4.30.0200.0276.26
4.4.20.0200.0206.26
4.4.10.0170.0236.26
4.4.00.0200.0506.26
4.3.110.0170.0236.26
4.3.100.0130.0236.26
4.3.90.0100.0236.26
4.3.80.0300.0336.26
4.3.70.0170.0176.26
4.3.60.0170.0206.26
4.3.50.0170.0236.26
4.3.40.0130.0376.26
4.3.30.0130.0236.26
4.3.20.0100.0206.26
4.3.10.0070.0236.26
4.3.00.0000.0238.42

preferences:
56.62 ms | 401 KiB | 5 Q