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++) { $tempArr = str_split($bigToken, $i); $tokens[] = array_shift($tempArr); //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.0120.00918.56
8.3.50.0110.00521.90
8.3.40.0070.01018.67
8.3.30.0120.00919.09
8.3.20.0000.00820.16
8.3.10.0040.00421.96
8.3.00.0040.00422.52
8.2.180.0150.00716.32
8.2.170.0080.00622.96
8.2.160.0100.00321.07
8.2.150.0050.00324.18
8.2.140.0030.00524.66
8.2.130.0000.00726.16
8.2.120.0050.00319.48
8.2.110.0040.00422.12
8.2.100.0090.00317.84
8.2.90.0040.00419.35
8.2.80.0060.00318.05
8.2.70.0000.00917.63
8.2.60.0000.00817.93
8.2.50.0080.00018.07
8.2.40.0040.00418.34
8.2.30.0070.00018.23
8.2.20.0070.00017.71
8.2.10.0000.00817.78
8.2.00.0040.00417.79
8.1.280.0030.01025.92
8.1.270.0040.00423.84
8.1.260.0000.00726.35
8.1.250.0060.00328.09
8.1.240.0170.00323.91
8.1.230.0090.00319.23
8.1.220.0060.00317.74
8.1.210.0050.00318.77
8.1.200.0040.00417.35
8.1.190.0070.00017.39
8.1.180.0040.00418.10
8.1.170.0040.00418.53
8.1.160.0040.00422.01
8.1.150.0000.00718.50
8.1.140.0040.00417.50
8.1.130.0000.00717.82
8.1.120.0040.00317.35
8.1.110.0030.00617.49
8.1.100.0000.00717.47
8.1.90.0050.00317.45
8.1.80.0040.00417.36
8.1.70.0000.01017.42
8.1.60.0000.00817.54
8.1.50.0070.00017.41
8.1.40.0080.00017.46
8.1.30.0000.00917.61
8.1.20.0040.00417.64
8.1.10.0040.00417.49
8.1.00.0000.00717.50
8.0.300.0050.00218.77
8.0.290.0040.00417.18
8.0.280.0000.00718.43
8.0.270.0050.00317.21
8.0.260.0030.00316.73
8.0.250.0080.00017.00
8.0.240.0070.00016.92
8.0.230.0070.00016.98
8.0.220.0030.00316.84
8.0.210.0000.00716.92
8.0.200.0030.00316.78
8.0.190.0000.00716.96
8.0.180.0080.00416.98
8.0.170.0040.00416.93
8.0.160.0070.00016.94
8.0.150.0000.00716.70
8.0.140.0000.00716.80
8.0.130.0000.00513.27
8.0.120.0030.00616.83
8.0.110.0000.00716.77
8.0.100.0040.00416.70
8.0.90.0050.00316.83
8.0.80.0030.01216.77
8.0.70.0040.00416.77
8.0.60.0080.00016.75
8.0.50.0040.00416.84
8.0.30.0130.00616.92
8.0.20.0160.00617.40
8.0.10.0070.00017.01
8.0.00.0100.00716.84
7.4.330.0050.00015.14
7.4.320.0000.00616.53
7.4.300.0030.00316.59
7.4.290.0030.00316.59
7.4.280.0000.00616.50
7.4.270.0040.00416.54
7.4.260.0060.00316.45
7.4.250.0070.00016.52
7.4.240.0030.00416.51
7.4.230.0040.00416.68
7.4.220.0030.01616.61
7.4.210.0100.00516.54
7.4.200.0000.00716.57
7.4.190.0030.00316.68
7.4.160.0080.00816.73
7.4.150.0160.00917.40
7.4.140.0010.01617.86
7.4.130.0110.00916.45
7.4.120.0080.01016.46
7.4.110.0110.01116.39
7.4.100.0100.00716.37
7.4.90.0100.00716.39
7.4.80.0110.00719.39
7.4.70.0150.00616.61
7.4.60.0130.00616.74
7.4.50.0030.00316.48
7.4.40.0030.01322.77
7.4.30.0000.01616.43
7.4.00.0060.00914.70
7.3.330.0000.00613.21
7.3.320.0050.00013.16
7.3.310.0000.00816.44
7.3.300.0050.00216.31
7.3.290.0060.01216.30
7.3.280.0100.00616.31
7.3.270.0180.00417.40
7.3.260.0120.00616.56
7.3.250.0100.01016.48
7.3.240.0060.01016.36
7.3.230.0080.00816.39
7.3.210.0100.01016.38
7.3.200.0070.01019.39
7.3.190.0110.00716.38
7.3.180.0100.00616.60
7.3.170.0100.00616.47
7.3.160.0070.01016.29
7.3.120.0070.01014.57
7.2.330.0100.00616.63
7.2.320.0100.00716.63
7.2.310.0060.01016.57
7.2.300.0070.01116.45
7.2.290.0120.00416.64
7.2.60.0040.00716.97
7.2.50.0000.01417.06
7.1.200.0070.00715.89
7.1.70.0070.00316.97
7.1.60.0070.01819.82
7.1.50.0070.01416.66
7.1.00.0070.07322.44
7.0.200.0080.00616.61
7.0.140.0100.06722.18
7.0.60.0100.03719.93
7.0.50.0070.03717.89
7.0.40.0030.04320.10
7.0.30.0300.05320.11
7.0.20.0300.06320.30
7.0.10.0100.04720.17
7.0.00.0070.07020.06
5.6.280.0100.06721.06
5.6.210.0070.05720.75
5.6.200.0030.07718.15
5.6.190.0000.04320.39
5.6.180.0170.04720.52
5.6.170.0230.03320.55
5.6.160.0070.04320.43
5.6.150.0030.07018.29
5.6.140.0030.05318.17
5.6.130.0030.04018.28
5.6.120.0030.05721.03
5.6.110.0030.07021.11
5.6.100.0000.04720.98
5.6.90.0000.07020.97
5.6.80.0030.07020.28
5.6.70.3470.04720.50
5.5.350.0170.04020.41
5.5.340.0100.07718.09
5.5.330.0030.09020.27
5.5.320.0230.05320.24
5.5.310.0270.06720.23
5.5.300.0130.07717.94
5.5.290.0000.04317.97
5.5.280.0100.08320.72
5.5.270.0000.04320.97
5.5.260.0030.08020.79
5.5.250.0130.05320.68
5.5.240.0030.08320.34
5.4.450.0900.03319.41
5.4.440.0700.04319.45
5.4.430.0430.03719.19
5.4.420.0430.04319.54
5.4.410.0200.05018.81
5.4.400.0070.06318.53
5.4.390.0130.05018.51
5.4.380.0200.05318.62
5.4.370.0300.05318.71
5.4.360.0230.05718.46
5.4.350.0370.05018.43
5.4.340.0330.04718.43
5.4.320.0040.03912.48
5.4.310.0060.03812.48
5.4.300.0040.04312.48
5.4.290.0040.04012.48
5.4.280.0060.03412.38
5.4.270.0060.04212.38
5.4.260.0050.03712.38
5.4.250.0040.03912.38
5.4.240.0040.03812.38
5.4.230.0070.03812.37
5.4.220.0070.04412.37
5.4.210.0040.03812.37
5.4.200.0050.04112.37
5.4.190.0200.03712.35
5.4.180.0150.04212.35
5.4.170.0160.04112.36
5.4.160.0140.04512.35
5.4.150.0140.04512.35
5.4.140.0150.04212.03
5.4.130.0150.04312.02
5.4.120.0160.04011.98
5.4.110.0100.04611.97
5.4.100.0170.07011.97
5.4.90.0200.03711.98
5.4.80.0170.04011.97
5.4.70.0130.04311.97
5.4.60.0140.04211.97
5.4.50.0100.04711.97
5.4.40.0120.04411.96
5.4.30.0130.04511.96
5.4.20.0140.04311.96
5.4.10.0130.04311.96
5.4.00.0210.06411.45
5.3.290.0050.04312.80
5.3.280.0050.03912.71
5.3.270.0160.04412.73
5.3.260.0160.04312.72
5.3.250.0180.04012.71
5.3.240.0150.04412.71
5.3.230.0170.04312.71
5.3.220.0150.04312.68
5.3.210.0160.04312.68
5.3.200.0130.04612.68
5.3.190.0190.04212.67
5.3.180.0170.04212.68
5.3.170.0360.08512.67
5.3.160.0160.04412.67
5.3.150.0210.03812.67
5.3.140.0170.04412.66
5.3.130.0220.03912.66
5.3.120.0140.04612.66
5.3.110.0180.04312.65
5.3.100.0190.04012.11
5.3.90.0200.03712.09
5.3.80.0150.04412.08
5.3.70.0180.04012.07
5.3.60.0340.08612.06
5.3.50.0150.04412.00
5.3.40.0110.04712.00
5.3.30.0130.04411.96
5.3.20.0150.04211.74
5.3.10.0140.04111.70
5.3.00.0150.04111.68
5.2.170.0180.0599.19
5.2.160.0110.0359.19
5.2.150.0130.0339.19
5.2.140.0110.0369.19
5.2.130.0140.0329.15
5.2.120.0100.0359.15
5.2.110.0120.0359.16
5.2.100.0100.0359.16
5.2.90.0090.0369.15
5.2.80.0130.0339.14
5.2.70.0130.0339.14
5.2.60.0210.0579.10
5.2.50.0130.0369.07
5.2.40.0160.0359.04
5.2.30.0380.0699.02
5.2.20.0130.0339.01
5.2.10.0100.0358.91
5.2.00.0110.0338.77
5.1.60.0110.0288.04
5.1.50.0140.0268.04
5.1.40.0130.0268.03
5.1.30.0210.0518.37
5.1.20.0100.0328.40
5.1.10.0100.0328.12
5.1.00.0090.0328.12
5.0.50.0090.0246.60
5.0.40.0120.0196.45
5.0.30.0050.0396.27
5.0.20.0080.0236.25
5.0.10.0070.0246.22
5.0.00.0070.0376.21
4.4.90.0260.0594.78
4.4.80.0060.0184.76
4.4.70.0080.0174.75
4.4.60.0050.0204.76
4.4.50.0040.0204.77
4.4.40.0090.0264.70
4.4.30.0080.0174.75
4.4.20.0080.0174.85
4.4.10.0080.0174.85
4.4.00.0070.0284.76
4.3.110.0080.0164.67
4.3.100.0090.0154.66
4.3.90.0060.0184.63
4.3.80.0170.0474.58
4.3.70.0060.0194.63
4.3.60.0060.0184.63
4.3.50.0080.0164.63
4.3.40.0110.0234.54
4.3.30.0030.0203.29
4.3.20.0040.0193.26
4.3.10.0050.0193.23
4.3.00.0000.01315.15

preferences:
44.23 ms | 400 KiB | 5 Q