3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sample = array('a.col1','a.col2','b.col1','c.col1','c.col2','d.col5'); $new = []; foreach($sample as $value){ $arr = explode(".", $value); if(array_key_exists($arr[0],$new)){ array_push($new[$arr[0]], $arr[1]); }else{; $new[$arr[0]][] = $arr[1]; } } print_r($new );

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.0040.00420.63
8.4.110.0100.00918.70
8.4.100.0080.01317.58
8.4.90.0150.00617.67
8.4.80.0050.00417.95
8.4.70.0040.00417.68
8.4.60.0110.01318.91
8.4.50.0140.00820.11
8.4.40.0080.00019.32
8.4.30.0130.00620.33
8.4.20.0030.00920.56
8.4.10.0100.01019.21
8.3.250.0110.00719.10
8.3.240.0120.00716.52
8.3.230.0130.00516.70
8.3.220.0130.00516.50
8.3.210.0080.00618.65
8.3.200.0060.00416.57
8.3.190.0080.00717.12
8.3.180.0060.00318.36
8.3.170.0110.00717.21
8.3.160.0100.00318.34
8.3.150.0150.00316.74
8.3.140.0150.00316.60
8.3.130.0130.00718.64
8.3.120.0030.00620.71
8.3.110.0170.00320.94
8.3.100.0060.00324.06
8.3.90.0040.00426.77
8.3.80.0040.00416.66
8.3.70.0110.00716.75
8.3.60.0040.01118.68
8.3.50.0100.00518.49
8.3.40.0040.01118.71
8.3.30.0110.00418.71
8.3.20.0050.00220.77
8.3.10.0000.00823.50
8.3.00.0040.00420.79
8.2.290.0090.00520.69
8.2.280.0110.00722.47
8.2.270.0110.00717.19
8.2.260.0070.01118.63
8.2.250.0060.00317.20
8.2.240.0080.00016.93
8.2.230.0050.00322.58
8.2.220.0000.00837.54
8.2.210.0030.00526.77
8.2.200.0060.00316.63
8.2.190.0060.00916.88
8.2.180.0100.01018.54
8.2.170.0040.01122.96
8.2.160.0100.00721.14
8.2.150.0050.00224.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0070.00026.16
8.2.110.0030.00620.88
8.2.100.0060.00617.91
8.2.90.0080.00018.22
8.2.80.0040.00420.44
8.2.70.0070.00417.93
8.2.60.0000.00818.03
8.2.50.0000.01018.10
8.2.40.0070.00019.47
8.2.30.0040.00419.29
8.2.20.0000.00718.07
8.2.10.0040.00418.94
8.2.00.0070.00019.26
8.1.330.0090.01016.42
8.1.320.0130.00615.96
8.1.310.0100.00718.39
8.1.300.0110.00420.37
8.1.290.0090.00030.84
8.1.280.0150.00025.92
8.1.270.0090.00020.76
8.1.260.0050.00226.35
8.1.250.0070.00028.09
8.1.240.0030.00622.11
8.1.230.0120.00020.84
8.1.220.0050.00317.78
8.1.210.0000.00818.90
8.1.200.0030.00617.35
8.1.190.0060.00317.23
8.1.180.0040.00418.10
8.1.170.0030.00618.90
8.1.160.0000.00720.13
8.1.150.0000.00718.95
8.1.140.0050.00218.89
8.1.130.0040.00419.23
8.1.120.0050.00217.47
8.1.110.0040.00417.48
8.1.100.0040.00417.46
8.1.90.0070.00017.35
8.1.80.0000.00817.43
8.1.70.0030.00717.28
8.1.60.0000.00917.60
8.1.50.0000.00817.45
8.1.40.0030.00617.50
8.1.30.0030.00517.55
8.1.20.0000.00917.54
8.1.10.0050.00317.60
8.1.00.0040.00417.54
8.0.300.0000.00819.96
8.0.290.0040.00416.63
8.0.280.0040.00418.36
8.0.270.0030.00317.18
8.0.260.0070.00016.81
8.0.250.0030.00316.93
8.0.240.0000.00716.97
8.0.230.0070.00016.89
8.0.220.0040.00416.82
8.0.210.0070.00016.88
8.0.200.0030.00316.97
8.0.190.0030.00516.82
8.0.180.0040.00417.01
8.0.170.0000.01116.90
8.0.160.0030.00716.95
8.0.150.0040.00416.79
8.0.140.0060.00316.86
8.0.130.0030.00313.41
8.0.120.0000.00716.88
8.0.110.0000.00817.00
8.0.100.0050.00216.88
8.0.90.0040.00416.76
8.0.80.0110.00716.90
8.0.70.0080.00016.67
8.0.60.0040.00416.96
8.0.50.0040.00416.76
8.0.30.0100.00716.86
8.0.20.0070.01117.11
8.0.10.0040.00416.91
8.0.00.0120.00916.79
7.4.330.0000.00615.55
7.4.320.0030.00316.61
7.4.300.0060.00016.52
7.4.290.0000.00716.44
7.4.280.0040.00416.50
7.4.270.0080.00016.52
7.4.260.0030.00313.18
7.4.250.0050.00216.48
7.4.240.0020.00616.59
7.4.230.0030.00316.66
7.4.220.0020.00516.65
7.4.210.0050.01116.62
7.4.200.0050.00216.61
7.4.130.0120.00816.60
7.4.120.0040.01416.34
7.4.110.0130.00316.57
7.4.100.0070.01016.47
7.4.90.0140.00316.48
7.4.80.0060.01219.39
7.4.70.0030.01416.60
7.4.60.0140.00716.26
7.4.50.0030.01016.47
7.4.40.0160.00616.35
7.4.00.0040.00814.84
7.3.330.0070.00016.25
7.3.320.0000.00613.21
7.3.310.0000.00716.47
7.3.300.0030.00316.32
7.3.290.0030.00316.18
7.3.280.0070.00716.32
7.3.260.0120.00716.45
7.3.240.0100.00716.41
7.3.230.0070.01416.55
7.3.210.0150.00716.23
7.3.200.0030.01216.25
7.3.190.0110.00716.45
7.3.180.0100.00616.45
7.3.170.0040.01816.34
7.3.160.0040.01216.44
7.3.110.0030.00914.44
7.3.100.0060.00614.60
7.3.90.0070.00514.55
7.3.80.0140.00514.88
7.3.70.0100.00314.38
7.3.60.0080.00514.70
7.3.50.0040.00814.76
7.3.40.0080.00514.79
7.3.30.0120.00614.62
7.3.20.0190.00014.78
7.3.10.0080.00614.76
7.3.00.0100.00614.60
7.2.330.0070.01016.45
7.2.320.0120.00916.75
7.2.310.0140.00416.82
7.2.300.0110.00716.39
7.2.290.0030.01316.73
7.2.240.0040.01114.49
7.2.230.0050.01014.91
7.2.220.0130.00315.08
7.2.210.0060.01315.13
7.2.200.0100.00715.10
7.2.190.0100.00514.88
7.2.180.0040.01214.76
7.2.170.0110.00614.88
7.2.160.0040.01115.06
7.2.150.0170.01014.79
7.2.140.0150.02114.93
7.2.130.0230.01915.15
7.2.120.0090.02614.85
7.2.110.0040.01114.96
7.2.100.0160.00015.13
7.2.90.0080.00814.80
7.2.80.0110.00414.77
7.2.70.0110.00514.86
7.2.60.0090.00614.65
7.2.50.0130.00515.00
7.2.40.0070.01014.93
7.2.30.0140.00314.84
7.2.20.0030.01214.61
7.2.10.0060.00914.79
7.2.00.0080.00815.00
7.1.330.0060.01113.61
7.1.320.0050.00713.65
7.1.310.0090.00613.87
7.1.300.0060.00913.86
7.1.290.0090.00614.06
7.1.280.0060.00613.86
7.1.270.0090.00613.73
7.1.260.0050.00913.76
7.1.250.0220.02513.95

preferences:
27.82 ms | 403 KiB | 5 Q