3v4l.org

run code in 300+ PHP versions simultaneously
<?php function benchmark(callable $function, $args=null, $count=1) { $time = microtime(1); for($i=0; $i<$count; $i++) { $result = is_array($args)? call_user_func_array($function, $args): call_user_func_array($function); } return array( 'total_time' => microtime(1) - $time, 'average_time' => (microtime(1) - $time)/$count, 'count' => $count ); } var_dump(benchmark('str_repeat', array('test',1E4))); gc_collect_cycles(); var_dump(benchmark('str_repeat', array('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.0090.00815.18
7.4.00.0060.01214.96
7.3.130.0070.01214.94
7.3.120.0060.01315.03
7.3.110.0060.01014.84
7.3.100.0060.01014.87
7.3.90.0040.00914.94
7.3.80.0060.00914.94
7.3.70.0060.00614.90
7.3.60.0050.01014.94
7.3.50.0030.01114.80
7.3.40.0070.00714.86
7.3.30.0080.00614.86
7.3.20.0090.00516.63
7.3.10.0050.01016.67
7.3.00.0070.00516.70
7.2.260.0100.00815.06
7.2.250.0080.00915.08
7.2.240.0080.00815.13
7.2.230.0070.00815.11
7.2.220.0050.00914.95
7.2.210.0070.01015.10
7.2.200.0050.01015.08
7.2.190.0090.00815.05
7.2.180.0060.00715.04
7.2.170.0040.01115.08
7.2.160.0080.00415.03
7.2.150.0070.00817.03
7.2.140.0030.01316.78
7.2.130.0030.01216.86
7.2.120.0060.00916.91
7.2.110.0060.01016.95
7.2.100.0100.00716.95
7.2.90.0070.00717.01
7.2.80.0080.00717.02
7.2.70.0050.01017.06
7.2.60.0060.01116.99
7.2.50.0090.00617.03
7.2.40.0050.00916.82
7.2.30.0070.00616.85
7.2.20.0040.00917.04
7.2.10.0060.00916.98
7.2.00.0050.00917.44
7.1.330.0060.00815.88
7.1.320.0080.00415.69
7.1.310.0030.01115.75
7.1.300.0070.00615.76
7.1.290.0080.00615.80
7.1.280.0080.00515.74
7.1.270.0050.00815.86
7.1.260.0050.01015.81
7.1.250.0080.00815.74
7.1.240.0050.00915.78
7.1.230.0060.00815.72
7.1.220.0060.00915.74
7.1.210.0060.00915.84
7.1.200.0050.00815.81
7.1.190.0060.00915.93
7.1.180.0090.00515.87
7.1.170.0050.00815.77
7.1.160.0030.00815.75
7.1.150.0020.01115.63
7.1.140.0050.00815.74
7.1.130.0030.01215.62
7.1.120.0010.01415.80
7.1.110.0070.00515.84
7.1.100.0040.00615.83
7.1.90.0060.00515.83
7.1.80.0050.00915.76
7.1.70.0030.00916.20
7.1.60.0100.00516.62
7.1.50.0040.00916.15
7.1.40.0060.00915.77
7.1.30.0060.00715.79
7.1.20.0050.00515.97
7.1.10.0060.00915.79
7.1.00.0050.01217.44
7.0.330.0050.01015.26
7.0.320.0080.00615.32
7.0.310.0050.00815.38
7.0.300.0070.00615.37
7.0.290.0060.00915.41
7.0.280.0080.00715.29
7.0.270.0030.00815.34
7.0.260.0040.00815.31
7.0.250.0060.00815.37
7.0.240.0020.01215.34
7.0.230.0070.00615.27
7.0.220.0060.00715.41
7.0.210.0060.00715.31
7.0.200.0110.00515.67
7.0.190.0070.00615.37
7.0.180.0030.00915.29
7.0.170.0010.01115.54
7.0.160.0060.00715.46
7.0.150.0060.00915.25
7.0.140.0090.02017.14
7.0.130.0070.00415.48
7.0.120.0050.00815.39
7.0.110.0030.00815.40
7.0.100.0030.01215.41
7.0.90.0050.00715.41
7.0.80.0050.00915.38
7.0.70.0050.02216.94
7.0.60.0050.01916.92
7.0.50.0060.01617.08
7.0.40.0080.02315.10
7.0.30.0030.02015.13
7.0.20.0040.02915.08
7.0.10.0060.02415.09
7.0.00.0030.03115.18
5.6.400.0060.00814.32
5.6.390.0070.00714.46
5.6.380.0070.00714.25
5.6.370.0110.00414.33
5.6.360.0090.00414.16
5.6.350.0060.00814.25
5.6.340.0040.00914.39
5.6.330.0110.00314.43
5.6.320.0050.00714.24
5.6.310.0080.00514.23
5.6.300.0060.01014.51
5.6.290.0080.00414.23
5.6.280.0050.02616.15
5.6.270.0020.01114.44
5.6.260.0060.00714.36
5.6.250.0060.00714.29
5.6.240.0060.00514.35
5.6.230.0020.01414.23
5.6.220.0090.02115.91
5.6.210.0040.02515.85
5.6.200.0070.01616.03
5.6.190.0070.02216.10
5.6.180.0070.02615.94
5.6.170.0050.02915.94
5.6.160.0050.02816.05
5.6.150.0070.02115.95
5.6.140.0060.02916.08
5.6.130.0100.02516.08
5.6.120.0070.02815.99
5.6.110.0050.03015.94
5.6.100.0060.02815.86
5.6.90.0040.03015.86
5.6.80.0040.02915.80
5.6.70.0040.02415.70
5.6.60.0060.02515.73
5.6.50.0060.02715.89
5.6.40.0030.02815.83
5.6.30.0050.02415.70
5.6.20.0040.02415.88
5.6.10.0070.02415.72
5.6.00.0080.01915.78
5.5.380.0040.00814.34
5.5.370.0050.01214.38
5.5.360.0070.02415.76
5.5.350.0030.02915.85
5.5.340.0080.01515.85
5.5.330.0060.02616.10
5.5.320.0090.02715.91
5.5.310.0030.03016.00
5.5.300.0050.02215.86
5.5.290.0060.02615.94
5.5.280.0060.02615.93
5.5.270.0060.02615.93
5.5.260.0080.02516.02
5.5.250.0060.02515.91
5.5.240.0020.02815.75
5.5.230.0040.02515.70
5.5.220.0070.02315.67
5.5.210.0060.02415.59
5.5.200.0080.02415.71
5.5.190.0050.02215.67
5.5.180.0050.02415.69
5.5.170.0060.01014.15
5.5.160.0060.01615.70
5.5.150.0080.02315.67
5.5.140.0090.02115.76
5.5.130.0100.01915.75
5.5.120.0100.02215.60
5.5.110.0040.02515.76
5.5.100.0060.02915.69
5.5.90.0030.02815.59
5.5.80.0050.02515.77
5.5.70.0070.01615.77
5.5.60.0030.02615.63
5.5.50.0090.02315.73
5.5.40.0060.01915.52
5.5.30.0040.02115.59
5.5.20.0070.02515.70
5.5.10.0060.02615.47
5.5.00.0020.02015.49
5.4.450.0060.02513.61
5.4.440.0080.02513.62
5.4.430.0020.02113.63
5.4.420.0050.02013.64
5.4.410.0070.02313.57
5.4.400.0070.02213.65
5.4.390.0050.01813.61
5.4.380.0040.02413.52
5.4.370.0060.02413.40
5.4.360.0040.02113.48
5.4.350.0030.02613.46
5.4.340.0010.02613.51
5.4.330.0060.00711.70
5.4.320.0020.01813.54
5.4.310.0050.02513.60
5.4.300.0030.02013.52
5.4.290.0020.01913.54
5.4.280.0020.01813.42
5.4.270.0060.02113.51
5.4.260.0030.02113.48
5.4.250.0020.02513.62
5.4.240.0050.02513.53
5.4.230.0050.02413.53
5.4.220.0030.02213.49
5.4.210.0080.01113.55
5.4.200.0050.02413.49
5.4.190.0050.02313.39
5.4.180.0070.02213.49
5.4.170.0060.02113.51
5.4.160.0030.02513.47
5.4.150.0040.01913.58
5.4.140.0040.01712.86
5.4.130.0020.02312.79
5.4.120.0050.01912.81
5.4.110.0030.02512.88
5.4.100.0040.02112.95
5.4.90.0030.02112.88
5.4.80.0030.02412.92
5.4.70.0040.02212.77
5.4.60.0050.01412.91
5.4.50.0020.01612.88
5.4.40.0050.02012.86
5.4.30.0030.01712.89
5.4.20.0030.01312.84
5.4.10.0040.02312.87
5.4.00.0030.02312.77
5.3.290.0020.02712.36
5.3.280.0020.02312.32
5.3.270.0080.02212.34
5.3.260.0030.02512.30
5.3.250.0070.02112.35
5.3.240.0050.02412.34
5.3.230.0040.02112.32
5.3.220.0040.02112.32
5.3.210.0050.02312.30
5.3.200.0030.02312.33
5.3.190.0050.02412.32
5.3.180.0050.02112.32
5.3.170.0040.02312.28
5.3.160.0030.02212.33
5.3.150.0060.02312.30
5.3.140.0030.01712.33
5.3.130.0020.01912.31
5.3.120.0040.02212.31
5.3.110.0030.01812.30
5.3.100.0060.02012.17
5.3.90.0040.01712.16
5.3.80.0020.02112.17
5.3.70.0070.01712.20
5.3.60.0040.02112.17
5.3.50.0030.02312.13
5.3.40.0050.01612.14
5.3.30.0020.02312.17
5.3.20.0040.01712.08
5.3.10.0030.02112.11
5.3.00.0040.01812.08
5.2.170.0070.06012.32
5.2.160.0070.04012.32
5.2.150.0000.07012.32
5.2.140.0000.06312.32
5.2.130.0030.04312.32
5.2.120.0030.04712.32
5.2.110.0000.04712.32
5.2.100.0000.03312.32
5.2.90.0000.06312.32
5.2.80.0000.06012.32
5.2.70.0000.06712.32
5.2.60.0000.06312.32
5.2.50.0070.05012.32
5.2.40.0100.05012.32
5.2.30.0000.06312.32
5.2.20.0000.06312.32
5.2.10.0030.05012.32
5.2.00.0030.06012.32
5.1.60.0030.05312.32
5.1.50.0000.06012.32
5.1.40.0030.04712.32
5.1.30.0070.04012.32
5.1.20.0070.05712.32
5.1.10.0030.05012.32
5.1.00.0030.05012.32
5.0.50.0070.04312.32
5.0.40.0030.04312.32
5.0.30.0030.06712.32
5.0.20.0100.04012.32
5.0.10.0070.04312.32
5.0.00.0000.06712.32
4.4.90.0030.02712.32
4.4.80.0030.02712.32
4.4.70.0000.03712.32
4.4.60.0030.03012.32
4.4.50.0000.03712.32
4.4.40.0000.05312.32
4.4.30.0000.04012.32
4.4.20.0000.03312.32
4.4.10.0030.03012.32
4.4.00.0000.04712.32
4.3.110.0070.03312.32
4.3.100.0100.03012.32
4.3.90.0000.03712.32
4.3.80.0030.05012.32
4.3.70.0030.03012.32
4.3.60.0000.03712.32
4.3.50.0030.03312.32
4.3.40.0000.05312.32
4.3.30.0030.02712.32
4.3.20.0000.02312.32
4.3.10.0070.03012.32
4.3.00.0000.03012.32

preferences:
32.87 ms | 401 KiB | 5 Q