3v4l.org

run code in 300+ PHP versions simultaneously
<?php function benchmarkMemory(callable $function, $args=null) { declare(ticks=1); $memory = memory_get_usage(); $max = 0; if(!function_exists('functionWithNoName')) { function functionWithNoName(&$memory, &$max) { $memory = memory_get_usage() - $memory; $max = $memory>$max?$memory:$max; $memory = memory_get_usage(); } } register_tick_function('functionWithNoName', $memory, $max); $result = is_array($args)? call_user_func_array($function, $args): call_user_func_array($function); unregister_tick_function('functionWithNoName'); return [ 'memory' => $max ]; } var_dump(benchmarkMemory('str_repeat', ['test',1E4]));//0 var_dump(benchmarkMemory('str_repeat', ['test',1E3]));//0

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)
7.4.10.0060.01015.25
7.4.00.0060.01014.91
7.3.130.0070.01014.93
7.3.120.0070.01014.86
7.3.110.0040.01614.95
7.3.100.0070.00714.83
7.3.90.0080.00815.09
7.3.80.0120.00314.87
7.3.70.0050.00914.83
7.3.60.0050.00914.86
7.3.50.0050.00914.89
7.3.40.0100.00514.79
7.3.30.0050.00614.96
7.3.20.0060.00716.72
7.3.10.0030.01016.56
7.3.00.0060.00616.58
7.2.260.0130.00615.19
7.2.250.0070.01115.00
7.2.240.0080.01015.11
7.2.230.0080.00615.03
7.2.220.0000.01415.14
7.2.210.0020.01414.94
7.2.200.0040.01115.11
7.2.190.0090.00714.99
7.2.180.0070.00714.95
7.2.170.0080.00714.90
7.2.160.0070.00715.02
7.2.150.0100.00316.92
7.2.140.0000.01416.97
7.2.130.0070.00716.99
7.2.120.0030.01316.67
7.2.110.0100.00316.91
7.2.100.0070.00716.54
7.2.90.0070.01016.78
7.2.80.0100.00716.84
7.2.70.0060.01216.87
7.2.60.0000.01516.74
7.2.50.0060.01016.69
7.2.40.0060.00916.92
7.2.30.0070.00416.71
7.2.20.0110.00316.97
7.2.10.0070.00717.00
7.2.00.0130.00717.00
7.1.330.0090.00615.79
7.1.320.0070.00715.83
7.1.310.0090.00715.77
7.1.300.0060.00615.73
7.1.290.0060.00915.88
7.1.280.0070.00215.88
7.1.270.0030.01015.85
7.1.260.0050.00815.62
7.1.250.0060.00815.90
7.1.240.0070.00715.82
7.1.230.0070.00715.64
7.1.220.0090.00315.89
7.1.210.0040.00415.95
7.1.200.0000.01815.85
7.1.190.0100.00715.72
7.1.180.0170.00015.99
7.1.170.0000.01615.94
7.1.160.0060.00915.83
7.1.150.0070.01015.64
7.1.140.0040.01115.97
7.1.130.0030.00915.84
7.1.120.0040.01415.56
7.1.110.0090.00615.77
7.1.100.0030.00615.73
7.1.90.0110.00615.92
7.1.80.0000.01416.02
7.1.70.0010.00816.40
7.1.60.0130.00517.48
7.1.50.0090.00616.22
7.1.40.0040.00815.54
7.1.30.0060.01015.65
7.1.20.0070.01015.92
7.1.10.0120.00015.81
7.1.00.0050.02819.13
7.0.330.0040.00415.47
7.0.320.0110.00315.46
7.0.310.0040.01515.30
7.0.300.0030.01015.43
7.0.290.0030.01315.42
7.0.280.0100.00715.57
7.0.270.0140.00015.42
7.0.260.0110.00315.47
7.0.250.0070.00715.48
7.0.240.0080.00815.57
7.0.230.0000.01415.59
7.0.220.0080.00815.43
7.0.210.0080.00615.45
7.0.200.0020.00715.81
7.0.190.0070.00715.49
7.0.180.0120.00415.24
7.0.170.0000.01415.46
7.0.160.0110.00415.62
7.0.150.0110.00015.46
7.0.140.0050.04118.62
7.0.130.0030.01415.36
7.0.120.0020.02018.95
7.0.110.0060.00615.50
7.0.100.0070.00415.48
7.0.90.0060.01215.54
7.0.80.0100.00615.41
7.0.70.0000.01115.32
7.0.60.0080.04517.55
7.0.50.0060.04516.80
7.0.40.0060.03716.95
7.0.30.0310.03316.84
7.0.20.0050.02716.90
7.0.10.0070.03616.78
7.0.00.0050.02916.76
5.6.400.0060.00614.77
5.6.390.0060.00614.18
5.6.380.0030.00714.70
5.6.370.0060.01213.97
5.6.360.0080.00814.55
5.6.350.0040.01114.54
5.6.340.0040.01114.43
5.6.330.0060.00614.13
5.6.320.0040.01114.54
5.6.310.0030.00914.55
5.6.300.0030.00914.64
5.6.290.0100.00314.53
5.6.280.0090.03917.72
5.6.270.0030.00914.13
5.6.260.0040.00814.64
5.6.250.0130.00314.41
5.6.240.0090.00914.46
5.6.230.0040.01114.26
5.6.220.0040.00414.27
5.6.210.0010.04917.43
5.6.200.0090.03516.20
5.6.190.0070.04217.52
5.6.180.0180.04117.24
5.6.170.0130.02617.39
5.6.160.0100.04517.44
5.6.150.0060.04616.38
5.6.140.0100.04316.28
5.6.130.0080.02216.20
5.6.120.0140.04017.76
5.6.110.0110.04617.81
5.6.100.0050.03317.68
5.6.90.0080.02717.70
5.6.80.0130.02217.37
5.6.70.2310.01817.36
5.6.60.0030.01014.37
5.6.50.0070.00714.28
5.6.40.0070.01014.26
5.6.30.0120.00014.38
5.6.20.0000.01213.96
5.6.10.0000.01314.18
5.6.00.0070.00314.14
5.5.380.0060.00914.07
5.5.370.0130.00314.44
5.5.360.0060.00914.46
5.5.350.0200.03117.29
5.5.340.0050.03816.11
5.5.330.0090.04017.32
5.5.320.0230.03017.28
5.5.310.0120.02917.40
5.5.300.0110.03816.19
5.5.290.0100.02516.13
5.5.280.0140.01617.64
5.5.270.0080.04717.41
5.5.260.0070.04517.50
5.5.250.0060.02817.59
5.5.240.2110.02317.30
5.5.230.0000.00914.13
5.5.220.0040.00814.41
5.5.210.0000.01714.16
5.5.200.0090.00014.19
5.5.190.0030.00914.02
5.5.180.0040.00814.24
5.5.170.0070.00313.96
5.5.160.0030.00914.38
5.5.150.0080.00814.10
5.5.140.0090.00614.41
5.5.130.0070.00714.43
5.5.120.0110.00314.50
5.5.110.0000.01514.38
5.5.100.0030.01414.23
5.5.90.0040.00814.26
5.5.80.0080.00414.37
5.5.70.0060.00613.78
5.5.60.0000.01514.23
5.5.50.0100.00713.80
5.5.40.0040.00814.01
5.5.30.0030.00914.01
5.5.20.0030.01314.10
5.5.10.0030.00714.33
5.5.00.0060.00914.16
5.4.450.0080.03215.81
5.4.440.0080.02015.75
5.4.430.0070.03315.66
5.4.420.0080.04215.81
5.4.410.0020.02315.60
5.4.400.0020.04015.65
5.4.390.0050.02815.67
5.4.380.0020.02415.50
5.4.370.0050.03715.61
5.4.360.0050.02315.50
5.4.350.0100.03715.61
5.4.340.0050.04015.69
5.4.330.0000.00612.14
5.4.320.0050.02715.69
5.4.310.0030.04015.63
5.4.300.0100.02215.56
5.4.290.0020.02715.50
5.4.280.0080.04015.50
5.4.270.0050.04415.51
5.4.260.0050.03815.64
5.4.250.0080.02615.65
5.4.240.0080.02515.56
5.4.230.0090.03815.63
5.4.220.0050.02715.57
5.4.210.0030.04315.54
5.4.200.0030.04215.49
5.4.190.0030.02015.53
5.4.180.0020.02615.49
5.4.170.0060.03315.49
5.4.160.0050.04215.49
5.4.150.0080.03015.61
5.4.140.0050.03714.23
5.4.130.0050.03914.26
5.4.120.0070.03814.23
5.4.110.0030.03714.27
5.4.100.0030.03814.28
5.4.90.0050.03814.30
5.4.80.0070.02214.28
5.4.70.0070.02314.29
5.4.60.0060.03314.27
5.4.50.0070.03314.25
5.4.40.0040.03714.32
5.4.30.0050.04014.23
5.4.20.0030.04014.27
5.4.10.0030.03614.27
5.4.00.0070.03714.03
5.3.290.0060.02913.41
5.3.280.0100.03313.37
5.3.270.0080.03713.40
5.3.260.0070.03813.38
5.3.250.0080.02613.38
5.3.240.0080.03513.40
5.3.230.0050.02213.37
5.3.220.0030.02313.44
5.3.210.0030.04513.38
5.3.200.0090.03713.36
5.3.190.0020.03813.32
5.3.180.0070.03913.43
5.3.170.0030.04113.36
5.3.160.0060.03313.30
5.3.150.0090.03613.36
5.3.140.0050.03813.29
5.3.130.0070.02813.36
5.3.120.0070.02313.36
5.3.110.0050.02613.37
5.3.100.0090.03413.12
5.3.90.0070.02713.05
5.3.80.0030.02613.09
5.3.70.0090.04013.09
5.3.60.0030.04113.11
5.3.50.0050.04213.08
5.3.40.0010.02413.08
5.3.30.0080.03513.03
5.3.20.0020.04212.90
5.3.10.0110.01512.93
5.3.00.0030.04212.88
5.2.170.0000.05311.21
5.2.160.0070.05711.16
5.2.150.0000.06711.22
5.2.140.0130.05311.14
5.2.130.0100.04011.11
5.2.120.0070.04011.11
5.2.110.0030.06311.16
5.2.100.0070.06011.03
5.2.90.0070.05711.16
5.2.80.0070.03711.14
5.2.70.0070.06011.16
5.2.60.0000.05711.07
5.2.50.0100.05711.02
5.2.40.0030.06311.03
5.2.30.0000.04011.02
5.2.20.0030.03310.96
5.2.10.0100.05311.03
5.2.00.0070.05310.72
5.1.60.0100.02710.04
5.1.50.0000.0579.91
5.1.40.0030.03010.00
5.1.30.0030.03710.39
5.1.20.0000.02710.41
5.1.10.0070.02010.06
5.1.00.0030.02310.05
5.0.50.0030.0478.56
5.0.40.0030.0338.42
5.0.30.0070.0338.29
5.0.20.0070.0278.18
5.0.10.0000.0408.18
5.0.00.0030.0638.15
4.4.90.0030.0337.95
4.4.80.0030.0207.95
4.4.70.0000.0407.95
4.4.60.0000.0177.95
4.4.50.0000.0307.95
4.4.40.0030.0477.95
4.4.30.0000.0377.95
4.4.20.0000.0207.95
4.4.10.0000.0237.95
4.4.00.0000.0437.95
4.3.110.0070.0307.95
4.3.100.0030.0137.95
4.3.90.0070.0177.95
4.3.80.0030.0377.95
4.3.70.0000.0207.95
4.3.60.0030.0177.95
4.3.50.0030.0137.95
4.3.40.0000.0377.95
4.3.30.0000.0277.95
4.3.20.0070.0277.95
4.3.10.0000.0207.95
4.3.00.0000.0237.95

preferences:
45.02 ms | 400 KiB | 5 Q