3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generate_result_array($where) { return array_fill(0, count($where), 0); } function generator($where) { for (;;) { yield rand(0, count($where) - 1); if (42 === rand(0, 100000)) { break; } } }; function main() { $where = [ 'Péché mignon', 'McDo', 'Flunch' ]; $results = generate_result_array($where); srand(time()); foreach (generator($where) as $result) { $results[$result]++; } echo $where[array_search(max($results), $results)], "\n"; } main();

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.0070.02215.17
7.4.00.0090.01515.16
7.3.130.0060.01914.95
7.3.120.0140.01415.04
7.3.110.0100.01615.08
7.3.100.0030.01414.69
7.3.90.0060.00914.81
7.3.80.0000.01615.07
7.3.70.0100.00314.91
7.3.60.0000.01914.92
7.3.50.0030.01314.79
7.3.40.0040.01514.70
7.3.30.0030.01614.68
7.3.20.0040.01216.52
7.3.10.0030.00916.41
7.3.00.0070.01116.59
7.2.260.0030.02115.21
7.2.250.0070.01415.12
7.2.240.0070.01315.12
7.2.230.0060.01215.07
7.2.220.0000.01914.77
7.2.210.0030.01014.87
7.2.200.0040.01214.96
7.2.190.0090.00915.16
7.2.180.0030.01014.98
7.2.170.0000.01814.95
7.2.160.0100.00714.87
7.2.150.0080.01517.03
7.2.140.0100.01016.93
7.2.130.0040.01416.95
7.2.120.0070.01616.79
7.2.110.0070.01417.09
7.2.100.0000.01316.91
7.2.90.0070.01417.08
7.2.80.0030.01616.93
7.2.70.0060.01317.00
7.2.60.0040.01516.98
7.2.50.0030.01416.99
7.2.40.0100.01016.98
7.2.30.0040.01516.77
7.2.20.0070.01017.11
7.2.10.0070.01117.17
7.2.00.0130.00716.89
7.1.330.0000.02515.88
7.1.320.0060.01315.69
7.1.310.0000.02515.96
7.1.300.0090.01515.95
7.1.290.0000.03515.43
7.1.280.0030.02315.47
7.1.270.0030.01715.92
7.1.260.0000.02815.91
7.1.250.0000.02715.86
7.1.240.0000.02415.78
7.1.230.0090.01515.95
7.1.220.0030.02215.94
7.1.210.0030.02215.93
7.1.200.0000.02115.64
7.1.190.0070.01415.90
7.1.180.0060.01915.79
7.1.170.0060.01215.62
7.1.160.0000.01915.69
7.1.150.0040.02116.00
7.1.140.0090.01515.93
7.1.130.0030.02215.95
7.1.120.0070.02015.86
7.1.110.0060.01915.79
7.1.100.0070.01815.95
7.1.90.0060.01915.86
7.1.80.0000.02115.92
7.1.70.0020.01816.52
7.1.60.0100.02117.49
7.1.50.0070.01416.38
7.1.40.0030.01716.04
7.1.30.0000.02415.80
7.1.20.0060.01515.68
7.1.10.0030.01315.66
7.1.00.0020.05519.22
7.0.330.0070.16015.39
7.0.320.0070.16915.46
7.0.310.0070.15315.38
7.0.300.0100.17015.42
7.0.290.0030.18015.40
7.0.280.0030.17915.14
7.0.270.0030.16915.42
7.0.260.0100.18015.37
7.0.250.0000.18015.53
7.0.240.0030.18015.13
7.0.230.0000.16715.42
7.0.220.0070.15715.30
7.0.210.0000.20515.22
7.0.200.0080.14115.97
7.0.190.0030.17415.13
7.0.180.0070.16315.50
7.0.170.0070.18415.52
7.0.160.0030.15915.54
7.0.150.0070.15215.41
7.0.140.0000.16418.79
7.0.130.0030.23115.37
7.0.120.0070.17215.15
7.0.110.0070.14315.42
7.0.100.0070.17715.25
7.0.90.0170.18617.69
7.0.80.0050.17517.74
7.0.70.0120.18017.56
7.0.60.0080.18517.64
7.0.50.0100.13517.75
7.0.40.0050.18716.73
7.0.30.0070.17616.61
7.0.20.0080.14516.80
7.0.10.0070.15016.78
7.0.00.0080.17216.81
5.6.400.0000.29114.18
5.6.390.0030.30014.64
5.6.380.0030.28614.57
5.6.370.0100.30914.68
5.6.360.0030.28914.18
5.6.350.0030.29514.76
5.6.340.0100.29414.61
5.6.330.0030.29014.79
5.6.320.0070.31214.44
5.6.310.0070.28314.39
5.6.300.0030.31914.30
5.6.290.0030.31914.57
5.6.280.0030.34117.72
5.6.270.0030.33414.57
5.6.260.0000.34414.11
5.6.250.0000.29014.33
5.6.240.0020.30717.54
5.6.230.0100.28617.46
5.6.220.0030.27117.50
5.6.210.0080.27617.49
5.6.200.0050.33917.69
5.6.190.0080.31417.79
5.6.180.0100.31117.77
5.6.170.0070.27617.85
5.6.160.0070.28117.83
5.6.150.0050.27617.77
5.6.140.0030.29017.86
5.6.130.0050.26617.72
5.6.120.0130.26717.74
5.6.110.0070.30717.69
5.6.100.0120.25817.75
5.6.90.0030.27617.86
5.6.80.0050.26617.26
5.6.70.0050.26317.30
5.6.60.0080.23717.35
5.6.50.0080.24317.44
5.6.40.0130.33017.42
5.6.30.0050.26017.47
5.6.20.0070.26217.48
5.6.10.0050.29317.35
5.6.00.0080.30817.42
5.5.380.0080.31217.20
5.5.370.0100.32617.23
5.5.360.0020.28617.34
5.5.350.0080.29017.38
5.5.340.0070.28217.36
5.5.330.0050.28817.73
5.5.320.0100.28617.70
5.5.310.0030.29817.49
5.5.300.0070.26217.56
5.5.290.0050.33717.56
5.5.280.0120.29917.47
5.5.270.0020.29517.56
5.5.260.0080.27817.70
5.5.250.0020.28817.45
5.5.240.0050.24817.31
5.5.230.0030.25817.26
5.5.220.0100.29417.31
5.5.210.0080.31017.24
5.5.200.0030.27817.41
5.5.190.0020.29417.21
5.5.180.0030.26617.31
5.5.170.0030.28314.37
5.5.160.0050.28217.37
5.5.150.0050.27817.31
5.5.140.0030.26917.08
5.5.130.0070.27617.47
5.5.120.0120.29417.37
5.5.110.0050.32317.23
5.5.100.0130.24517.11
5.5.90.0000.30817.19
5.5.80.0050.29317.16
5.5.70.0080.26617.03
5.5.60.0070.31117.24
5.5.50.0020.30317.07
5.5.40.0070.26617.02
5.5.30.0080.29417.31
5.5.20.0050.27417.22
5.5.10.0030.28517.28
5.5.00.0120.26817.11
5.4.450.0030.02515.95
5.4.440.0050.03316.09
5.4.430.0070.03816.14
5.4.420.0050.04015.95
5.4.410.0000.05015.93
5.4.400.0050.04015.92
5.4.390.0020.03015.82
5.4.380.0090.03315.88
5.4.370.0040.04115.98
5.4.360.0030.04015.92
5.4.350.0130.02615.95
5.4.340.0050.02515.88
5.4.330.0000.00712.73
5.4.320.0080.03715.93
5.4.310.0050.02515.89
5.4.300.0060.03315.93
5.4.290.0040.02815.84
5.4.280.0030.04315.97
5.4.270.0020.04415.88
5.4.260.0070.02315.97
5.4.250.0030.02515.92
5.4.240.0080.03515.80
5.4.230.0070.03815.87
5.4.220.0060.02315.87
5.4.210.0050.03215.92
5.4.200.0020.04415.78
5.4.190.0050.03015.80
5.4.180.0050.03715.87
5.4.170.0050.03715.95
5.4.160.0020.02915.95
5.4.150.0080.04015.87
5.4.140.0080.03214.58
5.4.130.0070.02714.61
5.4.120.0070.03014.55
5.4.110.0000.04314.59
5.4.100.0000.04514.56
5.4.90.0120.03814.64
5.4.80.0070.03514.61
5.4.70.0050.02014.61
5.4.60.0030.04314.59
5.4.50.0080.02114.52
5.4.40.0080.03514.63
5.4.30.0100.03314.57
5.4.20.0050.03714.57
5.4.10.0030.03914.56
5.4.00.0080.03614.20
5.3.290.0080.02813.73
5.3.280.0030.04013.67
5.3.270.0020.04713.74
5.3.260.0030.03713.66
5.3.250.0070.03713.71
5.3.240.0100.03313.71
5.3.230.0120.03313.66
5.3.220.0040.02313.69
5.3.210.0070.04013.66
5.3.200.0000.03813.66
5.3.190.0080.03513.66
5.3.180.0050.03113.66
5.3.170.0040.03513.66
5.3.160.0070.03813.68
5.3.150.0080.03813.68
5.3.140.0040.03713.68
5.3.130.0080.03713.66
5.3.120.0120.03713.66
5.3.110.0050.02813.66
5.3.100.0030.04413.66
5.3.90.0060.02813.66
5.3.80.0050.02513.66
5.3.70.0030.04313.66
5.3.60.0050.03513.66
5.3.50.0090.03413.66
5.3.40.0030.03613.66
5.3.30.0070.04013.66
5.3.20.0020.04213.66
5.3.10.0030.03013.66
5.3.00.0020.03013.66
5.2.170.0030.04014.59
5.2.160.0070.03014.59
5.2.150.0070.03314.59
5.2.140.0030.03014.59
5.2.130.0030.04314.59
5.2.120.0130.05014.59
5.2.110.0130.05714.59
5.2.100.0070.06314.59
5.2.90.0000.06314.59
5.2.80.0030.06314.59
5.2.70.0170.04714.59
5.2.60.0030.04314.59
5.2.50.0070.06314.59
5.2.40.0030.05014.59
5.2.30.0000.05314.59
5.2.20.0030.04714.59
5.2.10.0100.03314.59
5.2.00.0070.05714.59
5.1.60.0030.05314.59
5.1.50.0030.05314.59
5.1.40.0070.03714.59
5.1.30.0000.04314.59
5.1.20.0030.06014.59
5.1.10.0030.04314.59
5.1.00.0030.05014.59
5.0.50.0070.03014.59
5.0.40.0070.05014.59
5.0.30.0070.06314.59
5.0.20.0000.04714.59
5.0.10.0070.04314.59
5.0.00.0100.04714.59
4.4.90.0070.02714.59
4.4.80.0030.03314.59
4.4.70.0030.03014.59
4.4.60.0100.02714.59
4.4.50.0030.03014.59
4.4.40.0030.05314.59
4.4.30.0030.03714.59
4.4.20.0100.02314.59
4.4.10.0030.03714.59
4.4.00.0000.06014.59
4.3.110.0000.03314.59
4.3.100.0030.03314.59
4.3.90.0000.03714.59
4.3.80.0030.04714.59
4.3.70.0030.03314.59
4.3.60.0070.03014.59
4.3.50.0070.02014.59
4.3.40.0030.03714.59
4.3.30.0000.02014.59
4.3.20.0000.03714.59
4.3.10.0000.03014.59
4.3.00.0000.03314.59

preferences:
39.86 ms | 401 KiB | 5 Q