3v4l.org

run code in 300+ PHP versions simultaneously
<?php $post = [ 'id_228' => 228, 'title_228' => "First", 'colour_228' => 'red', 'id_229' => 228, 'title_229' => "Second", 'colour_229' => 'blue']; // Transform data into a proper format $resultArray = []; foreach($post as $key => $val) { $key = explode('_',$key); $resultArray[$key[1]][$key[0]] = $val; } // Now do whatever you want to do var_dump($resultArray);

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.0090.00618.40
8.3.50.0030.01016.29
8.3.40.0080.00818.70
8.3.30.0090.01218.63
8.3.20.0000.01119.10
8.3.10.0080.00020.95
8.3.00.0040.00417.80
8.2.180.0000.01818.54
8.2.170.0080.01118.91
8.2.160.0190.00322.96
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00419.83
8.2.120.0000.00826.35
8.2.110.0060.00320.95
8.2.100.0090.00317.71
8.2.90.0040.00417.96
8.2.80.0030.00719.82
8.2.70.0050.00517.38
8.2.60.0050.00317.50
8.2.50.0050.00317.50
8.2.40.0030.00617.62
8.2.30.0080.00019.38
8.2.20.0000.00718.08
8.2.10.0040.00418.12
8.2.00.0000.00719.32
8.1.280.0120.00325.92
8.1.270.0080.00023.80
8.1.260.0040.00426.35
8.1.250.0030.00628.09
8.1.240.0070.00423.91
8.1.230.0000.01120.97
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0040.00417.23
8.1.190.0040.00417.22
8.1.180.0030.00618.10
8.1.170.0050.00317.62
8.1.160.0040.00418.77
8.1.150.0080.00018.81
8.1.140.0040.00417.61
8.1.130.0030.00319.05
8.1.120.0100.00017.31
8.1.110.0000.01017.48
8.1.100.0000.00717.49
8.1.90.0040.00417.41
8.1.80.0030.00517.38
8.1.70.0000.00917.36
8.1.60.0040.00417.61
8.1.50.0040.00417.40
8.1.40.0040.00417.54
8.1.30.0040.00417.68
8.1.20.0040.00417.66
8.1.10.0040.00417.49
8.1.00.0030.00517.46
8.0.300.0080.00020.03
8.0.290.0060.00316.63
8.0.280.0040.00418.44
8.0.270.0050.00216.82
8.0.260.0060.00017.18
8.0.250.0040.00416.92
8.0.240.0030.00316.96
8.0.230.0000.00716.84
8.0.220.0000.00716.75
8.0.210.0040.00416.83
8.0.200.0000.00716.98
8.0.190.0020.00516.93
8.0.180.0080.00016.94
8.0.170.0000.00816.80
8.0.160.0040.00416.89
8.0.150.0000.00716.88
8.0.140.0040.00416.84
8.0.130.0030.00313.31
8.0.120.0090.00016.87
8.0.110.0070.00016.79
8.0.100.0050.00316.74
8.0.90.0050.00316.89
8.0.80.0070.00816.79
8.0.70.0030.00516.86
8.0.60.0040.00416.75
8.0.50.0040.00416.88
8.0.30.0100.00917.05
8.0.20.0130.00817.40
8.0.10.0070.00017.05
8.0.00.0090.00916.58
7.4.330.0000.00515.55
7.4.320.0000.00716.63
7.4.300.0030.00316.59
7.4.290.0070.00016.62
7.4.280.0050.00316.49
7.4.270.0080.00016.61
7.4.260.0070.00016.48
7.4.250.0030.00316.43
7.4.240.0000.00716.54
7.4.230.0030.00316.61
7.4.220.0050.00316.50
7.4.210.0060.01216.64
7.4.200.0030.00316.69
7.4.160.0060.01016.55
7.4.140.0130.00817.86
7.4.130.0040.01516.49
7.4.120.0110.00916.53
7.4.110.0170.00716.61
7.4.100.0090.00916.25
7.4.90.0160.00616.53
7.4.80.0140.00319.39
7.4.70.0100.00716.52
7.4.60.0070.01016.46
7.4.50.0060.01216.54
7.4.40.0110.00716.68
7.4.00.0100.00614.97
7.3.330.0030.00313.07
7.3.320.0000.00513.08
7.3.310.0070.00016.39
7.3.300.0030.00316.36
7.3.290.0000.00716.23
7.3.280.0060.01516.31
7.3.260.0120.00616.36
7.3.240.0140.00516.43
7.3.230.0090.00916.43
7.3.210.0030.01316.48
7.3.200.0120.00416.22
7.3.190.0100.00716.66
7.3.180.0150.00616.38
7.3.170.0150.00916.54
7.3.160.0100.01316.41
7.3.120.0100.00715.08
7.3.110.0040.01414.77
7.3.100.0040.01214.94
7.3.90.0090.00614.84
7.3.80.0110.00314.79
7.3.70.0060.00614.81
7.3.60.0070.00314.86
7.3.50.0030.00614.84
7.3.40.0090.00614.80
7.3.30.0000.00914.85
7.3.20.0070.00716.66
7.3.10.0060.00616.77
7.3.00.0090.00316.81
7.2.330.0030.01516.62
7.2.320.0030.01316.66
7.2.310.0170.00716.77
7.2.300.0000.01916.66
7.2.290.0100.00616.91
7.2.250.0070.01415.18
7.2.240.0130.00315.07
7.2.230.0070.00715.05
7.2.220.0040.00714.97
7.2.210.0000.01414.75
7.2.200.0030.01315.24
7.2.190.0040.01115.14
7.2.180.0000.01615.07
7.2.170.0060.01214.97
7.2.60.1980.00614.86
7.2.50.2050.01215.13
7.2.40.2180.01115.00
7.2.30.1990.01115.43
7.2.20.1940.01015.32
7.2.10.1960.00715.44
7.2.00.1680.01215.46
7.1.330.0060.00615.80
7.1.320.0070.01015.68
7.1.310.0050.00515.89
7.1.300.0030.00915.88
7.1.290.0030.01215.98
7.1.280.0130.00315.55
7.1.270.0000.01215.79
7.1.260.0080.00415.91
7.1.200.0030.00915.73
7.1.170.1910.00614.08
7.1.160.1990.01416.90
7.1.150.1760.01316.72
7.1.140.1950.01116.65
7.1.130.2040.01316.98
7.1.120.2040.01116.98
7.1.110.2020.01616.02
7.1.100.1990.01416.28
7.1.90.2210.01016.07
7.1.80.2190.01116.17
7.1.70.3420.01115.43
7.1.60.2880.01333.38
7.1.50.2710.01232.94
7.1.40.2950.01432.64
7.1.30.2750.01232.70
7.1.20.2840.01932.97
7.1.10.2700.01214.86
7.1.00.2240.01314.83

preferences:
55.72 ms | 400 KiB | 5 Q