3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "test string", "lado lomidze needs a solution", "i made some research and found 'good' answers here; they really helped me." ]; // if not already all lowercase, use strtolower() foreach ($strings as &$string) { for ($i = 0, $len = strlen($string); $i < $len; $i += 2) { $string[$i] = strtoupper($string[$i]); } } 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.4.120.0110.00922.39
8.4.110.0130.00620.41
8.4.100.0140.00617.59
8.4.90.0150.00617.58
8.4.80.0120.00717.74
8.4.70.0060.00319.78
8.4.60.0100.01018.82
8.4.50.0100.01022.12
8.4.40.0030.01619.43
8.4.30.0110.01117.57
8.4.20.0040.01818.51
8.4.10.0100.00017.95
8.3.250.0130.00519.10
8.3.240.0110.00716.40
8.3.230.0130.00616.82
8.3.220.0110.00717.39
8.3.210.0090.00616.56
8.3.200.0050.00416.71
8.3.190.0090.00317.36
8.3.180.0120.00618.98
8.3.170.0160.00316.54
8.3.160.0060.01217.13
8.3.150.0120.00617.22
8.3.140.0030.00621.03
8.3.130.0030.00518.44
8.3.120.0060.00318.81
8.3.110.0040.00420.94
8.3.100.0000.00824.06
8.3.90.0050.00326.77
8.3.80.0050.00517.97
8.3.70.0030.01616.60
8.3.60.0130.00318.15
8.3.50.0090.00417.56
8.3.40.0090.00618.97
8.3.30.0120.00318.67
8.3.20.0030.00518.73
8.3.10.0050.00221.76
8.3.00.0040.00421.73
8.2.290.0040.00520.41
8.2.280.0140.00718.43
8.2.270.0110.00020.59
8.2.260.0180.00016.40
8.2.250.0080.00016.73
8.2.240.0040.00417.41
8.2.230.0080.00022.58
8.2.220.0080.00037.54
8.2.210.0070.00726.77
8.2.200.0060.00316.50
8.2.190.0120.00619.81
8.2.180.0000.01416.50
8.2.170.0090.00622.96
8.2.160.0110.00319.14
8.2.150.0070.00024.18
8.2.140.0060.00324.66
8.2.130.0080.00020.99
8.2.120.0000.00726.35
8.2.110.0080.00419.14
8.2.100.0060.00617.91
8.2.90.0000.00917.88
8.2.80.0030.00517.97
8.2.70.0030.00517.91
8.2.60.0000.00818.22
8.2.50.0080.00018.10
8.2.40.0030.00522.21
8.2.30.0000.00820.61
8.2.20.0040.00418.18
8.2.10.0050.00219.95
8.2.00.0090.00018.13
8.1.330.0110.00823.59
8.1.320.0100.01017.88
8.1.310.0060.00316.64
8.1.300.0040.00418.06
8.1.290.0030.00730.84
8.1.280.0110.00425.92
8.1.270.0070.00022.27
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0060.00319.11
8.1.230.0040.00720.93
8.1.220.0030.00717.79
8.1.210.0050.00318.77
8.1.200.0060.00317.25
8.1.190.0060.00319.01
8.1.180.0000.00818.10
8.1.170.0060.00318.50
8.1.160.0030.00518.85
8.1.150.0040.00418.97
8.1.140.0000.00718.92
8.1.130.0070.00020.29
8.1.120.0030.00717.39
8.1.110.0030.00517.53
8.1.100.0040.00417.46
8.1.90.0050.00317.37
8.1.80.0040.00417.38
8.1.70.0070.00017.52
8.1.60.0080.00017.60
8.1.50.0050.00317.46
8.1.40.0030.00617.52
8.1.30.0110.00017.68
8.1.20.0040.00417.70
8.1.10.0040.00417.53
8.1.00.0000.00817.54
8.0.300.0040.00418.77
8.0.290.0050.00316.63
8.0.280.0040.00418.53
8.0.270.0000.00816.84
8.0.260.0030.00321.99
8.0.250.0070.00016.93
8.0.240.0060.00517.01
8.0.230.0080.00016.96
8.0.220.0030.00316.87
8.0.210.0000.00816.85
8.0.200.0070.00016.93
8.0.190.0040.00416.86
8.0.180.0040.00416.96
8.0.170.0050.00316.93
8.0.160.0000.00716.80
8.0.150.0000.00716.80
8.0.140.0040.00416.84
8.0.130.0050.00013.38
8.0.120.0070.00016.88
8.0.110.0040.00416.98
8.0.100.0000.00716.97
8.0.90.0040.00416.86
8.0.80.0110.00516.81
8.0.70.0070.00016.88
8.0.60.0000.00716.94
8.0.50.0000.00716.90
8.0.30.0030.01416.87
8.0.20.0070.01117.40
8.0.10.0070.00016.92
8.0.00.0150.00316.62
7.4.330.0050.00015.55
7.4.320.0000.00716.66
7.4.300.0040.00416.61
7.4.290.0000.00716.59
7.4.280.0050.00316.66
7.4.270.0000.00716.43
7.4.260.0040.00416.60
7.4.250.0070.00016.64
7.4.240.0000.00716.55
7.4.230.0030.00316.52
7.4.220.0000.00816.62
7.4.210.0090.00616.59
7.4.200.0070.00016.64
7.4.140.0100.00917.86
7.4.130.0140.00916.68
7.4.120.0090.00816.48
7.4.110.0160.00016.65
7.4.100.0030.01416.64
7.4.90.0120.00616.56
7.4.80.0090.01519.39
7.4.70.0100.01016.62
7.4.60.0200.00516.61
7.4.50.0080.00816.56
7.4.40.0200.00316.60
7.4.00.0060.01115.12
7.3.330.0070.00013.28
7.3.320.0030.00313.19
7.3.310.0040.00416.29
7.3.300.0030.00316.33
7.3.290.0040.00416.33
7.3.280.0040.01116.40
7.3.260.0080.00916.51
7.3.240.0090.01116.47
7.3.230.0090.00916.34
7.3.210.0070.01216.39
7.3.200.0030.01416.61
7.3.190.0100.00616.36
7.3.180.0120.00616.30
7.3.170.0100.00716.58
7.3.160.0150.00316.38
7.3.120.0060.00914.73
7.3.110.0050.01114.99
7.3.100.0060.01014.87
7.3.90.0050.00814.96
7.3.80.0020.01114.60
7.3.70.0020.01414.81
7.3.60.0080.00614.86
7.3.50.0060.00814.90
7.3.40.0030.01114.78
7.3.30.0080.00714.77
7.3.20.0090.00316.63
7.3.10.0120.00316.71
7.3.00.0040.01116.46
7.2.330.0150.00316.41
7.2.320.0100.01316.80
7.2.310.0130.00316.77
7.2.300.0080.00816.83
7.2.290.0060.01216.70
7.2.250.0040.01115.14
7.2.240.0080.01015.11
7.2.230.0000.01314.77
7.2.220.0060.00815.05
7.2.210.0060.01015.21
7.2.200.0080.00515.13
7.2.190.0060.01015.05
7.2.180.0040.00814.98
7.2.170.0030.01115.08
7.2.160.0060.00915.14
7.2.150.0130.00616.87
7.2.140.0030.01016.70
7.2.130.0070.00716.57
7.2.120.0070.01016.93
7.2.110.0040.00816.85
7.2.100.0110.01015.68
7.2.90.0430.00715.90
7.2.80.1040.00816.05
7.2.70.0120.00916.10
7.2.60.0140.00615.87
7.2.50.0090.00915.97
7.2.40.0180.01216.07
7.2.30.0180.00516.03
7.2.20.0040.01315.97
7.2.10.0210.00315.81
7.2.00.0210.01015.96
7.1.330.0080.00415.79
7.1.320.0050.00915.69
7.1.310.0060.00816.00
7.1.300.0060.00915.74
7.1.290.0070.00715.65
7.1.280.0060.00715.80
7.1.270.0040.01215.71
7.1.260.0070.00715.77
7.1.250.0030.01015.82
7.1.220.0150.00314.05
7.1.210.0380.00913.85
7.1.200.0720.00014.12
7.1.190.0110.00813.96
7.1.180.0270.00413.86
7.1.170.0130.00614.02
7.1.160.1040.00713.74
7.1.150.0100.00314.02
7.1.140.0800.01013.96
7.1.130.0590.01014.04
7.1.120.0290.01013.71
7.1.110.0220.00313.79
7.1.100.0720.00314.05
7.1.90.1290.00313.95
7.1.80.0790.00414.11
7.1.70.0100.00713.91
7.1.60.1310.01531.89
7.1.50.2630.01332.08
7.1.40.3050.01731.85
7.1.30.3250.00331.99
7.1.20.2780.00932.13
7.1.10.2040.00613.89
7.1.00.2460.00713.76
5.6.380.0110.00314.46

preferences:
116.69 ms | 403 KiB | 5 Q