3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "hello my friend"; $newString = ''; foreach(str_split($string) as $char) { $asciiCode = ord($char); // 97 - a // 122 - z if ($asciiCode >= 97 && $asciiCode < 122) { $char += 1; } if (in_array($char, ['a', 'e', 'y', 'u', 'i', 'o'])) { // not 32, because we already added 1 before $char -= 33; } $newString .= chr($char); } echo $newString;

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.0100.01018.64
8.3.50.0120.00621.28
8.3.40.0110.00418.83
8.3.30.0160.00319.21
8.3.20.0040.00420.21
8.3.10.0050.00323.70
8.3.00.0040.00419.38
8.2.180.0040.01116.63
8.2.170.0140.00022.96
8.2.160.0070.00720.28
8.2.150.0000.00724.18
8.2.140.0060.00324.66
8.2.130.0000.00826.16
8.2.120.0000.00722.18
8.2.110.0060.01022.26
8.2.100.0000.01117.75
8.2.90.0050.00219.14
8.2.80.0060.00317.97
8.2.70.0000.00817.75
8.2.60.0090.00318.16
8.2.50.0000.00918.07
8.2.40.0040.00418.16
8.2.30.0060.00318.18
8.2.20.0040.00417.84
8.2.10.0000.00718.00
8.2.00.0000.00717.86
8.1.280.0160.00325.92
8.1.270.0040.00421.89
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00523.97
8.1.230.0060.00619.26
8.1.220.0040.00417.77
8.1.210.0000.00718.77
8.1.200.0060.00317.23
8.1.190.0030.00617.22
8.1.180.0000.00818.10
8.1.170.0040.00418.71
8.1.160.0000.00722.00
8.1.150.0040.00418.93
8.1.140.0000.00717.43
8.1.130.0030.00317.81
8.1.120.0030.00417.48
8.1.110.0050.00317.50
8.1.100.0040.00417.46
8.1.90.0040.00417.33
8.1.80.0030.00517.48
8.1.70.0050.00217.39
8.1.60.0060.00317.49
8.1.50.0060.00317.56
8.1.40.0080.00017.45
8.1.30.0000.00817.54
8.1.20.0050.00317.60
8.1.10.0040.00417.54
8.1.00.0040.00417.48
8.0.300.0000.00718.77
8.0.290.0040.00416.88
8.0.280.0000.00718.42
8.0.270.0000.00717.16
8.0.260.0030.00317.16
8.0.250.0000.00817.00
8.0.240.0000.00817.00
8.0.230.0070.00016.99
8.0.220.0030.00516.98
8.0.210.0040.00316.94
8.0.200.0030.00316.91
8.0.190.0090.00317.05
8.0.180.0050.00316.93
8.0.170.0040.00416.96
8.0.160.0070.00016.96
8.0.150.0000.00716.79
8.0.140.0040.00416.90
8.0.130.0000.00613.35
8.0.120.0000.00716.73
8.0.110.0030.00517.03
8.0.100.0040.00416.77
8.0.90.0040.00417.01
8.0.80.0110.00516.96
8.0.70.0000.00716.95
8.0.60.0000.00716.81
8.0.50.0040.00416.93
8.0.30.0090.01117.14
8.0.20.0100.00817.40
8.0.10.0040.00416.92
8.0.00.0130.00816.80
7.4.330.0060.00015.15
7.4.320.0030.00316.48
7.4.300.0030.00316.63
7.4.290.0070.00016.54
7.4.280.0030.00616.49
7.4.270.0040.00716.45
7.4.260.0030.00616.40
7.4.250.0040.00416.57
7.4.240.0030.00316.48
7.4.230.0030.00316.68
7.4.220.0170.00416.43
7.4.210.0080.00816.44
7.4.200.0000.00716.60
7.4.160.0110.00816.54
7.4.150.0140.00317.40
7.4.140.0070.01117.86
7.4.130.0100.00716.52
7.4.120.0100.00716.44
7.4.110.0110.00716.48
7.4.100.0070.01016.61
7.4.90.0150.00616.48
7.4.80.0100.00719.39
7.4.70.0100.01016.36
7.4.60.0060.01516.38
7.4.50.0030.00616.45
7.4.40.0170.00616.51
7.4.30.0030.01416.39
7.4.00.0080.00914.89
7.3.330.0000.00513.14
7.3.320.0000.00613.06
7.3.310.0000.00716.39
7.3.300.0040.00416.35
7.3.290.0090.00816.34
7.3.280.0090.01016.38
7.3.270.0140.00417.40
7.3.260.0070.01016.50
7.3.250.0100.00716.26
7.3.240.0100.00616.48
7.3.230.0070.01016.39
7.3.210.0170.00716.65
7.3.200.0070.01419.39
7.3.190.0060.01216.31
7.3.180.0110.00716.39
7.3.170.0170.00316.29
7.3.160.0060.01216.52
7.3.120.0030.01314.82
7.3.110.0060.00914.89
7.3.100.0060.00414.67
7.3.90.0010.01114.86
7.3.80.0030.00914.82
7.3.70.0050.00614.66
7.3.60.0040.00714.82
7.3.50.0040.01114.79
7.3.40.0070.00514.81
7.3.30.0040.00814.70
7.3.20.0060.00616.72
7.3.10.0060.00716.68
7.3.00.0040.01016.70
7.2.330.0030.01516.43
7.2.320.0100.00716.49
7.2.310.0100.00716.73
7.2.300.0070.01016.39
7.2.290.0090.00916.70
7.2.250.0030.01514.91
7.2.240.0070.01014.95
7.2.230.0060.01114.91
7.2.220.0020.01215.04
7.2.210.0100.00414.85
7.2.200.0070.00515.05
7.2.190.0060.00815.05
7.2.180.0100.00514.97
7.2.170.0060.01015.10
7.2.160.0080.00814.87
7.2.150.0100.00017.09
7.2.140.0030.00616.93
7.2.130.0040.00817.04
7.2.120.0000.01616.91
7.2.110.0090.00317.06
7.2.100.0130.00317.01
7.2.90.0040.01116.83
7.2.80.0000.01517.18
7.2.70.0000.01517.08
7.2.60.0050.01017.02
7.2.50.0040.00916.73
7.2.40.0030.01416.92
7.2.30.0000.01616.95
7.2.20.0000.01016.90
7.2.10.0000.01416.89
7.2.00.0040.00918.24
7.1.330.0060.00615.61
7.1.320.0080.00415.84
7.1.310.0040.01015.77
7.1.300.0080.00615.71
7.1.290.0060.00715.91
7.1.280.0040.00815.76
7.1.270.0060.00615.71
7.1.260.0040.01115.66
7.1.250.0060.01015.79
7.1.200.0000.01515.98
7.1.100.0090.00617.98
7.1.70.0090.00917.04
7.1.60.0000.02219.11
7.1.50.0110.01116.61
7.1.00.0100.07022.33
7.0.200.0030.00616.85
7.0.140.0030.07322.07
7.0.60.0170.07019.89
7.0.50.0030.08717.82
7.0.40.0000.09320.08
7.0.30.0270.08020.13
7.0.20.0230.03320.34
7.0.10.0100.04020.32
7.0.00.0130.08020.19
5.6.280.0000.07720.91
5.6.210.0070.07320.50
5.6.200.0100.03318.18
5.6.190.0100.07720.39
5.6.180.0330.07020.67
5.6.170.1430.05020.60
5.6.160.0030.06020.41
5.6.150.0000.04018.18
5.6.140.0030.08318.20
5.6.130.0130.08018.21
5.6.120.0170.07020.79
5.6.110.0030.04321.11
5.6.100.0200.04721.13
5.6.90.0030.08321.01
5.6.80.0030.06320.39
5.5.350.0200.05320.52
5.5.340.0070.07718.02
5.5.330.0070.04020.40
5.5.320.0430.04320.27
5.5.310.0270.07720.18
5.5.300.0070.08717.98
5.5.290.0030.07317.90
5.5.280.0000.04320.65
5.5.270.0100.06720.88
5.5.260.0130.08020.79
5.5.250.0070.08020.79
5.5.240.0330.06320.04
5.4.450.0170.05019.46
5.4.440.0930.05719.59
5.4.430.0430.06719.38
5.4.420.0670.00019.32
5.4.410.0630.00019.31
5.4.400.0770.00019.20
5.4.390.0600.00019.05
5.4.380.0630.00019.07
5.4.370.0670.00019.06
5.4.360.0630.00019.14
5.4.350.0630.00018.96
5.4.340.0050.03611.97
5.4.320.0070.03512.45
5.4.310.0080.03612.45
5.4.300.0070.03512.46
5.4.290.0060.03912.45
5.4.280.0060.04912.35
5.4.270.0070.04712.35
5.4.260.0060.03812.35
5.4.250.0110.03312.35
5.4.240.0100.03312.35
5.4.230.0080.03812.34
5.4.220.0030.04512.34
5.4.210.0070.03312.34
5.4.200.0070.03612.34
5.4.190.0060.03612.34
5.4.180.0040.03812.34
5.4.170.0060.03612.35
5.4.160.0090.03212.35
5.4.150.0080.03412.34
5.4.140.0100.03312.03
5.4.130.0100.03512.02
5.4.120.0040.04411.97
5.4.110.0070.04411.97
5.4.100.0040.04411.96
5.4.90.0070.03911.97
5.4.80.0060.03911.97
5.4.70.0080.04711.96
5.4.60.0100.04411.96
5.4.50.0100.04511.96
5.4.40.0080.04611.95
5.4.30.0080.04411.95
5.4.20.0110.04411.95
5.4.10.0060.04611.95
5.4.00.0070.04911.44
5.3.290.0080.05312.80
5.3.280.0060.04212.71
5.3.270.0060.04012.72
5.3.260.0060.03912.72
5.3.250.0160.02712.71
5.3.240.0060.03712.71
5.3.230.0140.03012.71
5.3.220.0100.03412.68
5.3.210.0090.03512.68
5.3.200.0040.03812.68
5.3.190.0100.03312.68
5.3.180.0030.03912.68
5.3.170.0090.03312.67
5.3.160.0100.03312.68
5.3.150.0070.03512.68
5.3.140.0020.04012.66
5.3.130.0070.03712.66
5.3.120.0110.03412.66
5.3.110.0050.03912.66
5.3.100.0070.03612.12
5.3.90.0080.03412.08
5.3.80.0090.03312.07
5.3.70.0070.03412.08
5.3.60.0070.03512.07
5.3.50.0080.03312.00
5.3.40.0140.03412.00
5.3.30.0140.04611.95
5.3.20.0070.04111.73
5.3.10.0050.03511.70
5.3.00.0080.03511.69
5.2.170.0050.0309.18
5.2.160.0030.0319.19
5.2.150.0050.0299.18
5.2.140.0060.0299.18
5.2.130.0060.0319.14
5.2.120.0050.0399.14
5.2.110.0040.0339.15
5.2.100.0080.0309.14
5.2.90.0040.0309.15
5.2.80.0030.0329.14
5.2.70.0050.0309.14
5.2.60.0040.0319.10
5.2.50.0100.0259.07
5.2.40.0040.0309.04
5.2.30.0050.0309.02
5.2.20.0060.0279.00
5.2.10.0070.0268.93
5.2.00.0060.0298.79
5.1.60.0040.0258.07
5.1.50.0060.0278.07
5.1.40.0010.0278.05
5.1.30.0100.0228.40
5.1.20.0060.0248.42
5.1.10.0040.0268.14
5.1.00.0050.0258.15
5.0.50.0040.0236.63
5.0.40.0050.0216.48
5.0.30.0030.0326.30
5.0.20.0010.0246.27
5.0.10.0060.0196.24
5.0.00.0050.0356.24
4.4.90.0030.0164.78
4.4.80.0030.0154.76
4.4.70.0020.0174.75
4.4.60.0030.0174.75
4.4.50.0040.0174.77
4.4.40.0040.0284.71
4.4.30.0030.0184.75
4.4.20.0030.0164.84
4.4.10.0020.0224.85
4.4.00.0030.0324.76
4.3.110.0040.0224.67
4.3.100.0050.0194.67
4.3.90.0030.0144.63
4.3.80.0020.0314.58
4.3.70.0050.0194.63
4.3.60.0080.0114.63
4.3.50.0020.0164.63
4.3.40.0020.0244.54
4.3.30.0010.0173.28
4.3.20.0020.0163.26
4.3.10.0010.0163.23
4.3.00.0000.0237.19

preferences:
51.43 ms | 401 KiB | 5 Q