3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sentences = [ 0 => 'The tiger is the national animal of India', 1 => 'The tiger is a large carnivorous mammal that roams the forests', 2 => 'The tiger feeds on animals that also live in the forest', 3 => 'The tiger does have a coat of orange with black stripes', 4 => 'Tigers, regardless of their subspecies, are carnivorous animals', 5 => 'The tiger is a protected species', ]; foreach ($sentences as $sentence) { $letters = preg_match_all ('~[a-z\d]~', strtolower($sentence), $out) ? $out [0] : []; $occurrences = array_count_values($letters); arsort($occurrences); $result[] = [ "sentence" => $sentence, "character" => key($occurrences), "occurrences" => current($occurrences) ]; } var_export($result);

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.0190.00316.75
8.3.50.0120.00316.40
8.3.40.0100.00619.11
8.3.30.0070.00719.01
8.3.20.0040.00421.95
8.3.10.0040.00421.86
8.3.00.0040.00418.98
8.2.180.0090.00618.41
8.2.170.0150.00022.96
8.2.160.0110.00319.46
8.2.150.0040.00424.18
8.2.140.0000.00924.66
8.2.130.0050.00319.77
8.2.120.0040.00426.35
8.2.110.0060.00321.15
8.2.100.0100.00317.91
8.2.90.0050.00318.16
8.2.80.0000.00817.97
8.2.70.0000.00917.93
8.2.60.0050.00318.22
8.2.50.0040.00418.28
8.2.40.0070.00020.40
8.2.30.0040.00419.56
8.2.20.0030.00618.21
8.2.10.0000.00718.19
8.2.00.0050.00318.25
8.1.280.0040.01125.92
8.1.270.0040.00420.35
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0050.00522.42
8.1.230.0090.00321.03
8.1.220.0000.00817.79
8.1.210.0000.00818.77
8.1.200.0030.00617.50
8.1.190.0060.00317.48
8.1.180.0030.00618.10
8.1.170.0030.00618.96
8.1.160.0050.00219.05
8.1.150.0040.00419.07
8.1.140.0070.00017.67
8.1.130.0030.00320.42
8.1.120.0040.00417.64
8.1.110.0040.00417.53
8.1.100.0000.00717.58
8.1.90.0030.00317.57
8.1.80.0080.00017.58
8.1.70.0030.00317.67
8.1.60.0060.00317.73
8.1.50.0050.00317.70
8.1.40.0060.00317.77
8.1.30.0000.00817.69
8.1.20.0000.00817.87
8.1.10.0050.00217.74
8.1.00.0000.00817.59
8.0.300.0070.00020.21
8.0.290.0090.00017.00
8.0.280.0000.00718.56
8.0.270.0040.00217.38
8.0.260.0060.00317.05
8.0.250.0070.00017.24
8.0.240.0030.00617.11
8.0.230.0000.00717.06
8.0.220.0040.00417.05
8.0.210.0050.00317.10
8.0.200.0030.00317.17
8.0.190.0070.00317.14
8.0.180.0040.00416.98
8.0.170.0060.00317.07
8.0.160.0040.00417.13
8.0.150.0040.00417.02
8.0.140.0040.00417.04
8.0.130.0000.00613.58
8.0.120.0030.00516.96
8.0.110.0000.00717.05
8.0.100.0000.00717.02
8.0.90.0080.00017.07
8.0.80.0100.00617.07
8.0.70.0000.00716.88
8.0.60.0040.00417.09
8.0.50.0030.00517.04
8.0.30.0080.01117.35
8.0.20.0090.01017.42
8.0.10.0050.00317.16
8.0.00.0090.01016.91
7.4.330.0050.00015.55
7.4.320.0030.00316.80
7.4.300.0000.00716.85
7.4.290.0070.00016.88
7.4.280.0000.00816.85
7.4.270.0030.00316.75
7.4.260.0070.00016.83
7.4.250.0040.00416.86
7.4.240.0040.00416.81
7.4.230.0030.00516.91
7.4.220.0000.00816.95
7.4.210.0140.00216.76
7.4.200.0030.00316.80
7.4.160.0120.00316.75
7.4.140.0110.01017.86
7.4.130.0150.00316.70
7.4.120.0090.00916.76
7.4.110.0100.00616.74
7.4.100.0090.01316.92
7.4.90.0100.00716.54
7.4.80.0140.01219.39
7.4.70.0170.00716.65
7.4.60.0030.01316.73
7.4.50.0160.00016.73
7.4.40.0100.00616.62
7.4.00.0100.00715.07
7.3.330.0000.00513.34
7.3.320.0060.00013.37
7.3.310.0000.00716.33
7.3.300.0000.00816.34
7.3.290.0000.00716.40
7.3.280.0090.00616.50
7.3.260.0120.00516.62
7.3.240.0080.01116.72
7.3.230.0170.00016.61
7.3.210.0170.00016.79
7.3.200.0040.01216.53
7.3.190.0070.01016.76
7.3.180.0100.01316.85
7.3.170.0140.00316.53
7.3.160.0090.00916.72
7.3.120.0060.00914.98
7.3.110.0070.01114.89
7.3.100.0030.01015.01
7.3.90.0070.01014.93
7.3.80.0070.00715.11
7.3.70.0060.00615.08
7.3.60.0070.00714.89
7.3.50.0070.01015.02
7.3.40.0060.00615.01
7.3.30.0030.01014.96
7.3.20.0090.00616.52
7.3.10.0060.00316.91
7.3.00.0040.01116.89
7.2.330.0150.00316.82
7.2.320.0090.00916.97
7.2.310.0070.01016.82
7.2.300.0030.01516.71
7.2.290.0070.01316.73
7.2.240.0000.01715.07
7.2.230.0040.01215.24
7.2.220.0090.00615.34
7.2.210.0070.01015.30
7.2.200.0120.00615.29
7.2.190.0060.00615.18
7.2.180.0040.00715.20
7.2.170.0120.00315.32
7.2.160.0060.00315.39
7.2.150.0080.00617.08
7.2.140.0030.01016.96
7.2.130.0060.00916.92
7.2.120.0100.00717.32
7.2.110.0100.00717.10
7.2.100.0060.00317.05
7.2.90.0080.00417.31
7.2.80.0040.00817.05
7.2.70.0060.00617.01
7.2.60.0050.00917.12
7.2.50.0070.00716.85
7.2.40.0190.00917.71
7.2.30.0180.01017.83
7.2.20.0210.00817.64
7.2.10.0230.00917.67
7.2.00.0150.01117.77
7.1.330.0100.00616.08
7.1.320.0000.00916.16
7.1.310.0060.00616.27
7.1.300.0060.00615.86
7.1.290.0000.01215.95
7.1.280.0060.00616.11
7.1.270.0000.01215.89
7.1.260.0100.00015.95
7.1.250.0060.00915.87
7.1.200.0060.00815.96
7.1.160.0310.01217.14
7.1.150.0360.01316.90
7.1.140.0310.01217.00
7.1.130.0480.01417.05
7.1.120.0360.01116.97
7.1.110.0310.01016.28
7.1.100.0550.01316.56
7.1.90.0480.01216.10
7.1.80.0380.01016.56
7.1.70.0330.01315.55
7.1.60.1010.01233.63
7.1.50.0610.01233.13
7.1.40.0570.01633.13
7.1.30.0660.01632.79
7.1.20.0600.01133.03
7.1.10.0500.01515.11
7.1.00.0450.01215.30

preferences:
50.03 ms | 400 KiB | 5 Q