3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = "PHP CODING TECH"; $counters = array_fill_keys(explode(' ', $input), 1); // ['PHP' => 1, 'CODING' => 1, 'TECH' => 1] do { $bump = true; // stop after this iteration unless more letters to output foreach ($counters as $word => &$len) { // $len is mod-by-ref for incrementing echo substr($word, 0, $len); // echo letters using $len if ($bump && isset($word[$len])) { // if no $len has been incremented during inner loop... ++$len; // increment this word's $len $bump = false; // permit outer loop to run again } } echo "\n"; // separate outputs } while (!$bump); // while still letters to output....

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.0120.01016.91
8.5.00.0160.01319.86
8.4.160.0140.01023.89
8.4.150.0010.00114.05
8.4.140.0090.01317.40
8.4.130.0110.00918.66
8.4.120.0090.00824.07
8.4.110.0080.00318.88
8.4.100.0140.00617.79
8.4.90.0020.00720.70
8.4.80.0130.00622.30
8.4.70.0090.00917.90
8.4.60.0140.00618.88
8.4.50.0080.00823.60
8.4.40.0100.00717.78
8.4.30.0030.01617.65
8.4.20.0130.00719.57
8.4.10.0100.00017.64
8.3.280.0110.00918.32
8.3.270.0090.01116.81
8.3.260.0060.00316.64
8.3.250.0010.00718.97
8.3.240.0130.00517.09
8.3.230.0050.00316.53
8.3.220.0100.00819.06
8.3.210.0110.00718.64
8.3.200.0130.00616.48
8.3.190.0110.00817.32
8.3.180.0050.00416.53
8.3.170.0180.00017.34
8.3.160.0090.00916.58
8.3.150.0070.01116.87
8.3.140.0030.01617.40
8.3.130.0090.00016.42
8.3.120.0050.00520.68
8.3.110.0030.00620.94
8.3.100.0060.00324.06
8.3.90.0070.00026.77
8.3.80.0030.00718.56
8.3.70.0150.00618.40
8.3.60.0180.00016.73
8.3.50.0110.00217.29
8.3.40.0040.01118.75
8.3.30.0130.01318.84
8.3.20.0080.00021.76
8.3.10.0050.00223.48
8.3.00.0070.00021.70
8.2.290.0110.00817.07
8.2.280.0120.00718.25
8.2.270.0090.00917.20
8.2.260.0040.00416.78
8.2.250.0050.00316.58
8.2.240.0090.00617.28
8.2.230.0030.00622.58
8.2.220.0070.00337.54
8.2.210.0150.00026.77
8.2.200.0040.00416.38
8.2.190.0070.00716.73
8.2.180.0140.00718.16
8.2.170.0090.00622.96
8.2.160.0060.00820.52
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0060.00321.00
8.2.120.0000.00826.35
8.2.110.0000.00920.91
8.2.100.0070.00718.03
8.2.90.0000.00919.26
8.2.80.0040.00417.97
8.2.70.0000.00818.04
8.2.60.0050.00318.05
8.2.50.0050.00318.28
8.2.40.0050.00320.42
8.2.30.0040.00419.60
8.2.20.0070.00018.03
8.2.10.0080.00018.10
8.2.00.0000.00718.09
8.1.330.0100.00916.09
8.1.320.0130.00515.84
8.1.310.0100.00718.38
8.1.300.0060.00318.32
8.1.290.0060.00330.84
8.1.280.0150.00025.92
8.1.270.0000.00823.91
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0090.00023.96
8.1.230.0070.00317.83
8.1.220.0040.00417.78
8.1.210.0030.00618.77
8.1.200.0060.00317.35
8.1.190.0080.00017.13
8.1.180.0040.00418.10
8.1.170.0040.00418.79
8.1.160.0000.00718.89
8.1.150.0000.00718.92
8.1.140.0060.00317.57
8.1.130.0030.00317.32
8.1.120.0040.00417.46
8.1.110.0030.00617.52
8.1.100.0060.00617.47
8.1.90.0030.00517.36
8.1.80.0000.00817.42
8.1.70.0030.00317.51
8.1.60.0030.00817.52
8.1.50.0030.00617.45
8.1.40.0040.00417.52
8.1.30.0050.00317.70
8.1.20.0080.00317.64
8.1.10.0030.00617.64
8.1.00.0030.00517.39
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0070.00018.45
8.0.270.0000.00816.82
8.0.260.0030.00316.82
8.0.250.0070.00016.83
8.0.240.0000.00716.95
8.0.230.0000.00716.82
8.0.220.0050.00516.93
8.0.210.0070.00016.91
8.0.200.0050.00316.84
8.0.190.0030.00616.92
8.0.180.0040.00416.93
8.0.170.0040.00416.86
8.0.160.0040.00416.75
8.0.150.0000.00716.81
8.0.140.0000.00716.88
8.0.130.0060.00013.29
8.0.120.0040.00416.81
8.0.110.0070.00016.80
8.0.100.0070.00016.80
8.0.90.0000.00716.78
8.0.80.0040.01116.92
8.0.70.0000.00716.87
8.0.60.0000.00716.89
8.0.50.0080.00016.70
8.0.30.0110.00617.11
8.0.20.0100.00917.40
8.0.10.0080.00016.84
8.0.00.0070.01116.93
7.4.330.0000.00515.55
7.4.320.0070.00016.51
7.4.300.0000.00616.61
7.4.290.0070.00016.59
7.4.280.0030.00616.59
7.4.270.0060.00016.61
7.4.260.0030.00316.38
7.4.250.0040.00416.61
7.4.240.0000.00816.50
7.4.230.0030.00316.50
7.4.220.0000.00816.39
7.4.210.0050.01016.62
7.4.200.0030.00316.71
7.4.160.0140.00216.54
7.4.140.0120.00817.86
7.4.130.0090.01616.62
7.4.120.0110.01216.48
7.4.110.0060.01516.61
7.4.100.0110.00716.37
7.4.90.0070.01416.34
7.4.80.0150.00419.39
7.4.70.0040.01416.59
7.4.60.0070.01016.52
7.4.50.0070.01016.46
7.4.40.0180.00516.52
7.4.00.0040.01214.79
7.3.330.0050.00013.19
7.3.320.0030.00313.07
7.3.310.0030.00316.32
7.3.300.0030.00316.36
7.3.290.0070.00016.30
7.3.280.0050.01016.35
7.3.260.0130.00416.56
7.3.240.0080.01016.40
7.3.230.0080.00816.31
7.3.210.0000.01616.29
7.3.200.0150.00316.60
7.3.190.0090.01216.32
7.3.180.0130.01016.42
7.3.170.0080.01516.30
7.3.160.0090.01316.50
7.3.10.0050.01016.67
7.3.00.0070.01016.77
7.2.330.0100.00916.74
7.2.320.0070.01316.70
7.2.310.0140.00316.68
7.2.300.0040.01316.78
7.2.290.0220.00016.65
7.2.130.0150.00016.68
7.2.120.0030.01217.01
7.2.110.0030.01416.71
7.2.100.0070.00716.91
7.2.90.0090.00616.96
7.2.80.0000.01516.69
7.2.70.0090.00616.71
7.2.60.0050.01016.90
7.2.50.0090.00416.98
7.2.40.0220.00817.45
7.2.30.0230.00917.48
7.2.20.0320.00717.48
7.2.10.0190.01117.20
7.2.00.0210.00817.42
7.1.250.0000.01115.91
7.1.200.0000.00815.90
7.1.160.0520.01516.68
7.1.150.0540.01316.59
7.1.140.0380.01216.83
7.1.130.0370.00816.86
7.1.120.0540.01216.46
7.1.110.0340.01216.11
7.1.100.0370.01015.75
7.1.90.1080.01216.40
7.1.80.0740.01116.54
7.1.70.0680.01115.33
7.1.60.0870.01933.30
7.1.50.1530.01432.83
7.1.40.1180.01132.80
7.1.30.0750.01932.86
7.1.20.0990.01732.75
7.1.10.0450.01414.59
7.1.00.0380.01414.77

preferences:
168.16 ms | 403 KiB | 5 Q