3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ 'hello', 'leetcode', 'atwood' ]; foreach ($strings as &$string) { $count = preg_match_all('~[aeiou]~', $string, $m, PREG_OFFSET_CAPTURE); for ($i = 1; $i <= $count; ++$i) { $vowelOffset = $m[0][$count - $i][1]; $swappedVowel = $m[0][$i - 1][0]; $string[$vowelOffset] = $swappedVowel; } } var_export($strings);

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.5.10.0110.00618.67
8.5.00.0130.00920.04
8.4.150.0020.00014.05
8.4.140.0090.01217.77
8.4.130.0120.00818.50
8.4.120.0110.00524.14
8.4.110.0110.01018.69
8.4.100.0070.00718.96
8.4.90.0120.00820.61
8.4.80.0120.00820.50
8.4.70.0040.00718.09
8.4.60.0140.00819.02
8.4.50.0120.00818.94
8.4.40.0120.00017.92
8.4.30.0060.00318.70
8.4.20.0040.01819.61
8.4.10.0060.00319.54
8.3.280.0130.00718.53
8.3.270.0150.00516.86
8.3.260.0150.00216.80
8.3.250.0110.00819.04
8.3.240.0100.00617.17
8.3.230.0060.00216.66
8.3.220.0130.00418.96
8.3.210.0080.00816.82
8.3.200.0030.00516.70
8.3.190.0090.00617.25
8.3.180.0160.00517.34
8.3.170.0070.01020.62
8.3.160.0000.00816.73
8.3.150.0110.00716.99
8.3.140.0090.00616.56
8.3.130.0060.00318.65
8.3.120.0000.00818.93
8.3.110.0060.00320.94
8.3.100.0050.00324.06
8.3.90.0070.00726.77
8.3.80.0070.00416.75
8.3.70.0150.00716.63
8.3.60.0060.00916.88
8.3.50.0100.00618.55
8.3.40.0100.00320.04
8.3.30.0090.01218.92
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0050.00326.16
8.2.290.0110.00720.29
8.2.280.0080.01018.55
8.2.270.0070.01117.33
8.2.260.0080.00018.52
8.2.250.0110.00716.76
8.2.240.0100.00617.27
8.2.230.0070.00422.58
8.2.220.0070.00337.54
8.2.210.0050.00326.77
8.2.200.0060.00316.75
8.2.190.0070.01417.00
8.2.180.0080.00825.92
8.2.170.0150.00618.90
8.2.160.0070.00722.96
8.2.150.0050.00225.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0070.00026.16
8.2.110.0000.00920.47
8.2.100.0060.00618.03
8.2.90.0000.00918.00
8.2.80.0050.00319.05
8.2.70.0000.00817.88
8.2.60.0040.00417.75
8.2.50.0040.00417.98
8.2.40.0030.00519.76
8.2.30.0000.00718.02
8.2.20.0000.00720.45
8.2.10.0040.00417.95
8.2.00.0070.00019.32
8.1.330.0060.00222.05
8.1.320.0130.00716.34
8.1.310.0090.00616.46
8.1.300.0090.00018.71
8.1.290.0000.00918.88
8.1.280.0120.00625.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00023.96
8.1.230.0040.00722.77
8.1.220.0040.00418.81
8.1.210.0000.00818.77
8.1.200.0030.00617.48
8.1.190.0050.00317.48
8.1.180.0030.01018.10
8.1.170.0000.00817.64
8.1.160.0080.00018.81
8.1.150.0050.00318.85
8.1.140.0050.00317.57
8.1.130.0040.00420.67
8.1.120.0050.00217.67
8.1.110.0000.00717.60
8.1.100.0000.00817.57
8.1.90.0050.00217.61
8.1.80.0070.00017.66
8.1.70.0000.00717.59
8.1.60.0050.00317.56
8.1.50.0000.00817.57
8.1.40.0040.00417.67
8.1.30.0000.00817.76
8.1.20.0070.00017.73
8.1.10.0200.00317.65
8.1.00.0140.00917.63
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0000.01118.50
8.0.270.0030.00416.86
8.0.260.0030.00318.41
8.0.250.0070.00017.04
8.0.240.0070.00017.08
8.0.230.0030.00617.11
8.0.220.0000.00716.93
8.0.210.0030.00316.90
8.0.200.0040.00417.03
8.0.190.0030.00317.13
8.0.180.0040.00717.04
8.0.170.0030.00617.06
8.0.160.0030.00617.09
8.0.150.0000.00716.93
8.0.140.0100.00816.95
8.0.130.0150.00416.80
8.0.120.0210.00017.01
8.0.110.0130.00517.06
8.0.100.0160.00316.94
8.0.90.0090.00917.08
8.0.80.0180.00017.04
8.0.70.0140.00516.95
8.0.60.0110.00716.94
8.0.50.0190.00016.80
8.0.30.0130.00417.01
8.0.20.0090.00917.09
8.0.10.0150.00317.14
8.0.00.0060.00617.19
7.4.330.0050.00015.55
7.4.320.0060.00016.70
7.4.300.0030.00816.70
7.4.290.0000.00716.75
7.4.280.0040.00416.61
7.4.270.0110.00916.68
7.4.260.0160.00516.59
7.4.250.0130.00816.56
7.4.240.0140.00716.72
7.4.230.0130.00616.62
7.4.220.0160.00316.67
7.4.210.0160.00316.66
7.4.200.0140.00516.71
7.4.190.0110.00816.80
7.4.180.0140.00516.84
7.4.160.0170.00316.59
7.4.150.0180.00016.67
7.4.140.0160.00316.60
7.4.130.0150.00316.69
7.4.120.0190.00016.59
7.4.110.0130.00516.62
7.4.100.0150.00416.81
7.4.90.0160.00316.57
7.4.80.0170.00316.70
7.4.70.0110.00416.50
7.4.60.0150.00316.67
7.4.50.0050.00516.45
7.4.40.0150.00316.54
7.4.30.0110.00616.51
7.4.20.0110.00016.48
7.4.10.0070.00516.45
7.4.00.0090.00216.37
7.3.330.0040.00816.48
7.3.320.0100.00316.40
7.3.310.0120.00016.43
7.3.300.0110.00916.46
7.3.290.0030.00916.44
7.3.280.0100.00316.18
7.3.270.0090.00616.13
7.3.260.0070.00516.41
7.3.250.0070.00716.35
7.3.240.0120.00316.30
7.3.230.0130.00716.55
7.3.220.0000.01116.50
7.3.210.0040.00416.41
7.3.200.0080.00016.23
7.3.190.0040.00416.48
7.3.180.0040.00416.23
7.3.170.0040.00416.44
7.3.160.0040.00816.43
7.3.150.0070.00716.32
7.3.140.0060.00616.36
7.3.130.0160.00016.24

preferences:
34.56 ms | 403 KiB | 5 Q