3v4l.org

run code in 300+ PHP versions simultaneously
<?php $inStr = 'Hey you guys'; $tokens = array(); $tokenList = explode(' ',$inStr); foreach($tokenList as $bigToken) { $tokens[] = $bigToken; //take care of individual words $tokens = array_merge($tokens, str_split($bigToken)); //take care of single letters for($i = 2; $i < strlen($bigToken); $i++) { $tokens[] = pop(str_split($bigToken)); //only need the first element here. } } print_r($tokens);

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.0180.00316.88
8.3.50.0050.01616.68
8.3.40.0120.00318.68
8.3.30.0060.01218.97
8.3.20.0080.00018.67
8.3.10.0060.00920.56
8.3.00.0100.00017.63
8.2.180.0100.00718.28
8.2.170.0110.00422.96
8.2.160.0110.00421.02
8.2.150.0070.01124.18
8.2.140.0040.01424.66
8.2.130.0080.00826.16
8.2.120.0080.00019.48
8.2.110.0060.00319.25
8.2.100.0120.00018.22
8.2.90.0000.00817.88
8.2.80.0000.00817.97
8.2.70.0070.00318.05
8.2.60.0070.00018.16
8.2.50.0000.00818.10
8.2.40.0050.00319.36
8.2.30.0040.00419.19
8.2.20.0000.00717.79
8.2.10.0050.00317.77
8.2.00.0070.00317.79
8.1.280.0140.00025.92
8.1.270.0040.00424.66
8.1.260.0060.00326.35
8.1.250.0000.00728.09
8.1.240.0050.00522.14
8.1.230.0080.00418.89
8.1.220.0030.00517.79
8.1.210.0030.00718.77
8.1.200.0050.00517.35
8.1.190.0000.00817.36
8.1.180.0000.00818.10
8.1.170.0080.00018.59
8.1.160.0000.00718.84
8.1.150.0050.00218.83
8.1.140.0070.00317.41
8.1.130.0000.00717.84
8.1.120.0000.00817.48
8.1.110.0000.00717.38
8.1.100.0030.00517.44
8.1.90.0000.00717.35
8.1.80.0030.00317.47
8.1.70.0030.00317.46
8.1.60.0040.00417.47
8.1.50.0040.00417.48
8.1.40.0040.00417.49
8.1.30.0040.00417.63
8.1.20.0070.00017.65
8.1.10.0000.00817.50
8.1.00.0030.00517.45
8.0.300.0080.00018.77
8.0.290.0080.00016.75
8.0.280.0030.00518.52
8.0.270.0000.00717.27
8.0.260.0030.00316.86
8.0.250.0030.00616.91
8.0.240.0040.00417.00
8.0.230.0000.00717.02
8.0.220.0000.00716.92
8.0.210.0000.00716.94
8.0.200.0000.00817.03
8.0.190.0000.00717.03
8.0.180.0000.00817.00
8.0.170.0030.00617.02
8.0.160.0050.00316.87
8.0.150.0000.00716.92
8.0.140.0120.00516.90
8.0.130.0050.00313.45
8.0.120.0000.00816.86
8.0.110.0080.00016.95
8.0.100.0070.00016.83
8.0.90.0000.00717.01
8.0.80.0060.00916.95
8.0.70.0030.00516.84
8.0.60.0050.00317.01
8.0.50.0040.00416.82
8.0.30.0100.00916.92
8.0.20.0130.00817.38
8.0.10.0050.00517.01
8.0.00.0100.01017.02
7.4.330.0000.00512.98
7.4.320.0050.00216.53
7.4.300.0060.00016.60
7.4.290.0000.00716.59
7.4.280.0050.00316.52
7.4.270.0000.00616.54
7.4.260.0030.00313.29
7.4.250.0040.00716.51
7.4.240.0020.00616.51
7.4.230.0040.00416.62
7.4.220.0190.00616.59
7.4.210.0040.01416.53
7.4.200.0070.00016.30
7.4.190.0030.00316.76
7.4.160.0100.00716.50
7.4.150.0130.00416.61
7.4.140.0140.00416.61
7.4.130.0100.00816.67
7.4.120.0080.00916.54
7.4.110.0100.01016.43
7.4.100.0080.00816.45
7.4.90.0100.00716.43
7.4.80.0060.01219.39
7.4.70.0030.01316.56
7.4.60.0150.00016.48
7.4.50.0060.00316.75
7.4.40.0060.00616.54
7.4.30.0080.00816.59
7.4.00.0000.01615.09
7.3.330.0060.00013.41
7.3.320.0070.00013.29
7.3.310.0030.00316.47
7.3.300.0000.00616.23
7.3.290.0030.01216.46
7.3.280.0080.00616.43
7.3.270.0070.01016.47
7.3.260.0200.00316.58
7.3.250.0080.01116.43
7.3.240.0130.00316.39
7.3.230.0070.01016.43
7.3.210.0100.00616.61
7.3.200.0070.01016.63
7.3.190.0080.01216.51
7.3.180.0030.01716.64
7.3.170.0200.00316.51
7.3.160.0080.01116.58
7.3.120.0030.01314.66
7.3.10.0100.00616.87
7.3.00.0100.00616.72
7.2.330.0000.01816.63
7.2.320.0080.00816.75
7.2.310.0200.00316.72
7.2.300.0150.00316.55
7.2.290.0080.00816.59
7.2.130.0040.01116.92
7.2.120.0070.00717.05
7.2.110.0390.00716.74
7.2.100.0040.00717.03
7.2.90.0060.00917.03
7.2.80.0040.01116.59
7.2.70.0070.00716.81
7.2.60.0100.00817.04
7.2.50.0030.00716.79
7.2.40.0060.00616.81
7.2.30.0100.00317.07
7.2.20.0100.00317.00
7.2.10.0040.00717.02
7.2.00.0060.00818.11
7.1.250.0080.00015.79
7.1.200.0000.01315.71
7.1.100.0040.01118.23
7.1.70.0000.01517.23
7.1.60.0110.01419.40
7.1.50.0260.01034.79
7.1.00.0070.04722.46
7.0.200.0230.00914.82
7.0.140.0000.07721.97
7.0.120.0030.07321.96
7.0.60.0100.04719.82
7.0.50.0030.06717.85
7.0.40.0070.04320.20
7.0.30.0270.05020.12
7.0.20.0300.04320.01
7.0.10.0270.06020.00
7.0.00.0070.04320.19
5.6.280.0030.07021.14
5.6.210.0130.07020.51
5.6.200.0130.05018.17
5.6.190.0070.06020.66
5.6.180.0300.07720.43
5.6.170.0270.07720.70
5.6.160.0030.05020.44
5.6.150.0130.04318.23
5.6.140.0070.08018.16
5.6.130.0100.08018.07
5.6.120.0030.08321.14
5.6.110.0070.09021.00
5.6.100.0100.08321.11
5.6.90.0030.04320.97
5.6.80.0000.04320.50
5.6.70.2770.02320.52
5.5.350.0270.05320.41
5.5.340.0100.04318.02
5.5.330.0070.07720.40
5.5.320.0070.06320.21
5.5.310.0300.07320.21
5.5.300.0100.07717.90
5.5.290.0000.06717.87
5.5.280.0030.05320.88
5.5.270.0070.07320.79
5.5.260.0130.04320.83
5.5.250.0030.07720.65
5.5.240.0100.08020.34
5.4.450.0100.07319.46
5.4.440.0070.06019.32
5.4.430.0130.04319.50
5.4.420.0130.03319.13
5.4.410.0100.07319.31
5.4.400.0130.07019.15
5.4.390.0070.05719.08
5.4.380.0070.06318.79
5.4.370.0130.04019.16
5.4.360.0030.06018.79
5.4.350.0070.05319.15
5.4.340.0070.07018.80
5.4.320.0070.04319.18
5.4.310.0100.03319.18
5.4.300.0070.07018.91
5.4.290.0030.08018.82
5.4.280.0070.07719.08
5.4.270.0030.08018.78
5.4.260.0130.07019.08
5.4.250.0100.06018.91
5.4.240.0130.07319.17
5.4.230.0100.07318.78
5.4.220.0100.04319.17
5.4.210.0070.07018.79
5.4.200.0070.07719.14
5.4.190.0170.06718.78
5.4.180.0100.04319.17
5.4.170.0200.05318.91
5.4.160.0230.06019.15
5.4.150.0070.08019.15
5.4.140.0100.06016.24
5.4.130.0000.05316.43
5.4.120.0100.05016.24
5.4.110.0000.04016.26
5.4.100.0000.05716.24
5.4.90.0100.04016.39
5.4.80.0070.03316.30
5.4.70.0100.04316.29
5.4.60.0100.07016.34
5.4.50.0030.07316.36
5.4.40.0030.05316.23
5.4.30.0000.08016.28
5.4.20.0030.05016.36
5.4.10.0170.06316.21
5.4.00.0070.05015.93
5.3.290.0030.04014.61
5.3.280.0100.07314.41
5.3.270.0030.05314.61
5.3.260.0170.07014.39
5.3.250.0100.07314.39
5.3.240.0000.06014.55
5.3.230.0130.07014.55
5.3.220.0100.04014.58
5.3.210.0030.04314.48
5.3.200.0070.05014.50
5.3.190.0070.06014.46
5.3.180.0030.06714.54
5.3.170.0000.04314.35
5.3.160.0030.05014.35
5.3.150.0100.06014.49
5.3.140.0070.08014.34
5.3.130.0030.06714.43
5.3.120.0130.04014.48
5.3.110.0030.07714.51
5.3.100.0000.05014.12
5.3.90.0130.06713.96
5.3.80.0000.05014.11
5.3.70.0000.06313.94
5.3.60.0200.06013.84
5.3.50.0070.05713.78
5.3.40.0070.04013.73
5.3.30.0100.07313.70
5.3.20.0000.04013.50
5.3.10.0070.07313.63
5.3.00.0030.07313.47
5.2.170.0000.04011.02
5.2.160.0070.04711.08
5.2.150.0100.05711.22
5.2.140.0000.05711.00
5.2.130.0030.04011.18
5.2.120.0070.06011.27
5.2.110.0000.03310.95
5.2.100.0100.03710.92
5.2.90.0070.05311.07
5.2.80.0130.05711.02
5.2.70.0030.05311.17
5.2.60.0030.04010.98
5.2.50.0070.06010.87
5.2.40.0070.04710.88
5.2.30.0070.04710.95
5.2.20.0100.05710.81
5.2.10.0030.04311.02
5.2.00.0070.06010.71
5.1.60.0070.0539.97
5.1.50.0070.05710.07
5.1.40.0030.0379.95
5.1.30.0000.06310.34
5.1.20.0070.05310.25
5.1.10.0100.04310.08
5.1.00.0070.05310.21
5.0.50.0000.0278.59
5.0.40.0000.0278.41
5.0.30.0030.0308.20
5.0.20.0000.0208.21
5.0.10.0030.0238.09
5.0.00.0070.0608.20
4.4.90.0000.0377.98
4.4.80.0100.0107.98
4.4.70.0000.0237.98
4.4.60.0030.0207.98
4.4.50.0030.0337.98
4.4.40.0000.0337.98
4.4.30.0030.0377.98
4.4.20.0030.0377.98
4.4.10.0030.0337.98
4.4.00.0030.0277.98
4.3.110.0000.0377.98
4.3.100.0000.0207.98
4.3.90.0000.0337.98
4.3.80.0070.0307.98
4.3.70.0100.0307.98
4.3.60.0070.0207.98
4.3.50.0000.0237.98
4.3.40.0030.0337.98
4.3.30.0000.0337.98
4.3.20.0030.0337.98
4.3.10.0030.0237.98
4.3.00.0000.0377.98

preferences:
43.43 ms | 401 KiB | 5 Q