3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Benchmark { private static $max, $memory; public static function memoryTick() { self::$memory = memory_get_usage() - self::$memory; self::$max = self::$memory>self::$max?self::$memory:self::$max; self::$memory = memory_get_usage(); } public static function benchmarkMemory(callable $function, $args=null) { declare(ticks=1); self::$memory = memory_get_usage(); self::$max = 0; register_tick_function('call_user_func_array', ['Benchmark', 'memoryTick'], []); $result = is_array($args)? call_user_func_array($function, $args): call_user_func_array($function); unregister_tick_function('call_user_func_array'); return [ 'memory' => self::$max ]; } } var_dump(Benchmark::benchmarkMemory('str_repeat', ['test',1E4])); var_dump(Benchmark::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)
7.4.10.0100.01015.11
7.4.00.0060.01314.86
7.3.130.0030.01614.73
7.3.120.0070.01114.64
7.3.110.0080.01114.82
7.3.100.0090.00814.70
7.3.90.0050.00814.93
7.3.80.0030.01114.87
7.3.70.0040.00614.63
7.3.60.0100.00314.75
7.3.50.0110.00615.01
7.3.40.0040.00814.78
7.3.30.0040.00914.65
7.3.20.0030.00716.80
7.3.10.0050.00616.48
7.3.00.0090.00516.63
7.2.260.0070.01315.14
7.2.250.0060.01014.94
7.2.240.0020.01615.05
7.2.230.0030.01414.86
7.2.220.0050.01115.18
7.2.210.0080.00614.96
7.2.200.0010.01215.02
7.2.190.0000.01415.10
7.2.180.0110.00515.00
7.2.170.0050.01014.96
7.2.160.0060.01015.03
7.2.150.0100.00616.92
7.2.140.0070.00716.89
7.2.130.0080.00416.83
7.2.120.0030.00616.70
7.2.110.0040.00816.91
7.2.100.0040.00816.87
7.2.90.0060.00917.04
7.2.80.0030.01316.96
7.2.70.0030.00617.04
7.2.60.0070.00717.01
7.2.50.0120.00316.92
7.2.40.0090.00616.56
7.2.30.0000.01117.00
7.2.20.0030.00617.05
7.2.10.0100.00716.91
7.2.00.0100.00418.17
7.1.330.0070.00715.64
7.1.320.0070.00515.70
7.1.310.0090.00515.74
7.1.300.0030.01215.61
7.1.290.0060.00715.77
7.1.280.0020.01215.72
7.1.270.0050.00615.77
7.1.260.0040.00715.74
7.1.250.0060.00915.61
7.1.240.0060.00615.84
7.1.230.0090.00615.62
7.1.220.0030.00715.53
7.1.210.0000.01515.94
7.1.200.0040.01115.74
7.1.190.0030.01015.87
7.1.180.0030.00915.71
7.1.170.0060.00615.75
7.1.160.0000.01315.66
7.1.150.0060.00615.81
7.1.140.0060.00915.47
7.1.130.0080.00815.91
7.1.120.0090.00615.50
7.1.110.0090.00615.61
7.1.100.0060.00615.71
7.1.90.0040.00715.68
7.1.80.0040.00415.95
7.1.70.0040.00516.58
7.1.60.0080.01017.57
7.1.50.0030.01216.24
7.1.40.0030.01315.77
7.1.30.0030.01315.79
7.1.20.0000.00915.48
7.1.10.0000.01115.68
7.1.00.0090.03719.16
7.0.330.0030.01015.43
7.0.320.0060.00915.32
7.0.310.0100.00315.29
7.0.300.0030.00715.43
7.0.290.0080.00315.35
7.0.280.0030.00615.08
7.0.270.0000.01115.45
7.0.260.0040.01115.46
7.0.250.0100.00715.45
7.0.240.0130.00015.29
7.0.230.0070.00715.45
7.0.220.0040.01115.44
7.0.210.0000.01215.38
7.0.200.0060.00415.93
7.0.190.0070.00715.48
7.0.180.0100.00715.32
7.0.170.0100.00715.61
7.0.160.0040.00715.32
7.0.150.0070.00715.25
7.0.140.0070.03818.76
7.0.130.0100.00715.39
7.0.120.0060.00615.14
7.0.110.0030.01015.36
7.0.100.0120.04317.79
7.0.90.0130.03817.80
7.0.80.0200.04417.66
7.0.70.0100.03017.65
7.0.60.0100.04517.67
7.0.50.0230.03817.75
7.0.40.0100.03716.79
7.0.30.0030.02916.79
7.0.20.0050.04216.77
7.0.10.0030.04416.78
7.0.00.0120.03716.70
5.6.400.0060.00914.68
5.6.390.0040.01114.45
5.6.380.0060.00314.42
5.6.370.0030.01414.43
5.6.360.0130.00314.79
5.6.350.0080.00614.69
5.6.340.0040.00814.47
5.6.330.0030.00614.64
5.6.320.0030.01314.54
5.6.310.0070.00714.74
5.6.300.0000.01414.47
5.6.290.0080.00314.58
5.6.280.0030.04217.51
5.6.270.0030.00814.51
5.6.260.0120.00614.54
5.6.250.0060.04617.44
5.6.240.0030.04517.50
5.6.230.0050.04617.67
5.6.220.0080.04217.49
5.6.210.0040.04417.44
5.6.200.0070.03917.59
5.6.190.0050.03317.68
5.6.180.0060.04817.73
5.6.170.0070.04517.68
5.6.160.0040.04817.72
5.6.150.0060.04317.78
5.6.140.0140.03917.88
5.6.130.0080.04317.74
5.6.120.0030.03217.58
5.6.110.0110.04117.87
5.6.100.0090.04117.75
5.6.90.0070.04917.82
5.6.80.0080.03717.54
5.6.70.0140.03617.26
5.6.60.0050.04317.49
5.6.50.0070.04117.32
5.6.40.0070.04317.33
5.6.30.0050.04317.29
5.6.20.0140.03417.40
5.6.10.0090.04317.31
5.6.00.0130.03417.22
5.5.380.0060.02817.48
5.5.370.0030.04717.55
5.5.360.0050.02917.47
5.5.350.0100.04317.32
5.5.340.0060.04617.53
5.5.330.0110.04117.63
5.5.320.0070.04517.66
5.5.310.0120.03517.54
5.5.300.0070.04317.59
5.5.290.0050.03517.64
5.5.280.0080.02717.63
5.5.270.0040.03817.55
5.5.260.0070.04717.42
5.5.250.0020.05217.41
5.5.240.0070.03917.27
5.5.230.0070.04217.27
5.5.220.0130.04017.16
5.5.210.0080.04017.31
5.5.200.0080.03517.26
5.5.190.0050.04217.13
5.5.180.0070.04417.16
5.5.170.0090.00414.32
5.5.160.0070.04417.32
5.5.150.0070.04517.24
5.5.140.0040.03317.22
5.5.130.0100.03317.21
5.5.120.0070.04517.05
5.5.110.0070.04417.31
5.5.100.0050.04517.26
5.5.90.0050.04017.08
5.5.80.0070.04517.04
5.5.70.0020.03317.07
5.5.60.0030.04317.03
5.5.50.0100.03817.01
5.5.40.0050.02717.15
5.5.30.0080.03717.20
5.5.20.0090.04017.00
5.5.10.0070.02517.21
5.5.00.0080.02617.12
5.4.450.0020.04715.35
5.4.440.0030.04315.48
5.4.430.0080.03715.43
5.4.420.0030.03015.49
5.4.410.0030.02715.45
5.4.400.0070.03515.33
5.4.390.0060.02615.19
5.4.380.0070.03515.33
5.4.370.0110.03615.27
5.4.360.0060.04115.33
5.4.350.0100.03315.27
5.4.340.0070.04015.27
5.4.330.0040.00811.50
5.4.320.0080.02015.29
5.4.310.0080.02415.26
5.4.300.0050.03515.31
5.4.290.0070.03715.31
5.4.280.0070.02315.31
5.4.270.0070.03815.31
5.4.260.0060.04315.27
5.4.250.0020.02715.34
5.4.240.0110.02715.26
5.4.230.0080.04515.31
5.4.220.0020.04515.29
5.4.210.0070.03215.31
5.4.200.0080.02515.27
5.4.190.0080.03615.21
5.4.180.0070.03815.36
5.4.170.0070.03915.21
5.4.160.0100.03115.29
5.4.150.0070.04115.16
5.4.140.0100.03614.00
5.4.130.0030.04113.93
5.4.120.0060.03113.87
5.4.110.0020.03513.91
5.4.100.0070.03813.95
5.4.90.0050.03814.03
5.4.80.0100.03413.95
5.4.70.0030.03813.96
5.4.60.0070.03313.97
5.4.50.0080.04013.97
5.4.40.0070.02514.00
5.4.30.0050.03713.96
5.4.20.0050.02514.00
5.4.10.0030.02714.01
5.4.00.0090.03713.71
5.3.290.0040.03813.12
5.3.280.0050.04313.08
5.3.270.0060.02513.07
5.3.260.0080.03813.13
5.3.250.0000.02613.11
5.3.240.0030.03813.05
5.3.230.0050.04313.07
5.3.220.0070.03713.04
5.3.210.0060.03813.00
5.3.200.0050.03413.01
5.3.190.0060.03413.11
5.3.180.0050.03213.07
5.3.170.0110.04013.07
5.3.160.0080.03613.00
5.3.150.0070.04213.01
5.3.140.0030.04013.01
5.3.130.0030.04113.10
5.3.120.0090.02013.08
5.3.110.0070.04013.03
5.3.100.0000.03412.78
5.3.90.0070.02312.77
5.3.80.0070.03812.79
5.3.70.0060.03612.83
5.3.60.0060.03612.78
5.3.50.0050.03812.78
5.3.40.0070.03512.73
5.3.30.0070.03712.73
5.3.20.0020.03612.66
5.3.10.0070.03512.59
5.3.00.0040.02612.64
5.2.170.0100.04311.17
5.2.160.0030.03711.05
5.2.150.0100.03311.14
5.2.140.0000.04011.07
5.2.130.0030.06311.16
5.2.120.0100.05711.12
5.2.110.0030.06011.02
5.2.100.0030.05711.01
5.2.90.0030.03711.16
5.2.80.0000.03311.16
5.2.70.0070.05711.01
5.2.60.0070.05711.07
5.2.50.0030.03711.04
5.2.40.0100.05710.90
5.2.30.0030.06311.10
5.2.20.0000.03311.11
5.2.10.0000.03010.96
5.2.00.0070.05310.63
5.1.60.0070.0509.99
5.1.50.0070.04010.07
5.1.40.0070.0509.98
5.1.30.0070.03010.21
5.1.20.0070.03710.47
5.1.10.0000.03010.16
5.1.00.0030.03310.18
5.0.50.0030.0409.11
5.0.40.0000.0309.11
5.0.30.0030.0309.11
5.0.20.0030.0339.11
5.0.10.0070.0409.11
5.0.00.0000.0439.11
4.4.90.0070.0309.11
4.4.80.0070.0309.11
4.4.70.0000.0209.11
4.4.60.0030.0339.11
4.4.50.0000.0339.11
4.4.40.0070.0239.11
4.4.30.0000.0409.11
4.4.20.0000.0309.11
4.4.10.0030.0279.11
4.4.00.0030.0439.11
4.3.110.0000.0239.11
4.3.100.0000.0339.11
4.3.90.0000.0279.11
4.3.80.0070.0439.11
4.3.70.0070.0309.11
4.3.60.0030.0279.11
4.3.50.0000.0379.11
4.3.40.0030.0539.11
4.3.30.0000.0379.11
4.3.20.0070.0179.11
4.3.10.0030.0179.11
4.3.00.0000.0179.11

preferences:
37.29 ms | 401 KiB | 5 Q