3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '&client_sku=item1&service[0][name]=Relay&service[0][service_type]=RS&service[0][tier][0][from]=1&service[0][tier][0][to]=10&service[0][tier][1][from]=11'; parse_str($string, $output); $rowObjectExample = ''; foreach($output as $name => $value) { if(isset($output[$name])) { if(is_array($value)) { $i = 0; $length = count($value); foreach($value as $key=>$val) { $i++; $rowObjectExample .= $name.'_row '.$name.'Row'; if($length > 1) { $rowObjectExample .= ($i <= $length ? $key : ''); } $rowObjectExample .= ' = new '.$name.'_row()'.";\n\t"; if(is_array($val)) { foreach($val as $k=>$v) { if(is_array($v)) { $n = 0; $len = count($v); foreach ($v as $row=>$column) { $rowObjectExample .= $k.'_row '.$k.'Row'; if(is_array($column)) { foreach($column as $r=>$c) { $n++; if($len > 1) { $rowObjectExample .= ($n <= $len ? $row : ''); } $rowObjectExample .= '.'.$r.' = '.$c."\n\t"; } } } } else { $rowObjectExample .= $name.'Row'; if($length > 1) { $rowObjectExample .= ($i <= $length ? $key : ''); } $rowObjectExample .= '.'.$k.' = '.$v."\n\t"; } } } } } } } var_dump($rowObjectExample);

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.70.0150.00616.58
8.3.60.0090.00916.73
8.3.50.0170.00522.05
8.3.40.0090.00618.74
8.3.30.0140.00019.04
8.3.20.0070.00020.34
8.3.10.0080.00021.85
8.3.00.0050.00317.59
8.2.190.0120.00316.58
8.2.180.0100.00725.92
8.2.170.0090.00622.96
8.2.160.0130.00020.28
8.2.150.0070.00025.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0030.00520.86
8.2.110.0030.00720.87
8.2.100.0110.00017.75
8.2.90.0040.00419.11
8.2.80.0060.00317.97
8.2.70.0040.00417.38
8.2.60.0050.00318.03
8.2.50.0060.00318.07
8.2.40.0050.00320.07
8.2.30.0050.00218.00
8.2.20.0000.00817.74
8.2.10.0000.00718.05
8.2.00.0060.00618.12
8.1.280.0150.00625.92
8.1.270.0070.00020.32
8.1.260.0040.00426.35
8.1.250.0110.00428.09
8.1.240.0060.00321.25
8.1.230.0040.00717.89
8.1.220.0090.00017.79
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0060.00317.00
8.1.180.0050.00318.10
8.1.170.0000.00818.50
8.1.160.0000.00721.94
8.1.150.0030.00518.86
8.1.140.0080.00017.44
8.1.130.0040.00417.51
8.1.120.0000.00717.36
8.1.110.0040.00417.50
8.1.100.0000.00717.48
8.1.90.0030.00317.46
8.1.80.0050.00317.48
8.1.70.0030.00717.42
8.1.60.0000.00817.59
8.1.50.0000.01117.53
8.1.40.0040.00417.54
8.1.30.0030.00617.64
8.1.20.0080.00017.60
8.1.10.0000.00717.59
8.1.00.0070.00017.37
8.0.300.0000.00718.77
8.0.290.0000.00716.75
8.0.280.0000.00718.39
8.0.270.0030.00317.20
8.0.260.0000.00716.84
8.0.250.0070.00016.81
8.0.240.0080.00017.01
8.0.230.0040.00216.84
8.0.220.0040.00416.94
8.0.210.0000.00816.95
8.0.200.0000.00716.84
8.0.190.0040.00416.97
8.0.180.0040.00416.81
8.0.170.0040.00416.90
8.0.160.0040.00416.93
8.0.150.0040.00416.85
8.0.140.0040.00416.84
8.0.130.0000.00513.35
8.0.120.0040.00416.85
8.0.110.0000.00716.91
8.0.100.0000.00817.01
8.0.90.0040.00416.95
8.0.80.0100.01016.83
8.0.70.0030.00516.89
8.0.60.0040.00417.00
8.0.50.0050.00316.91
8.0.30.0140.00617.11
8.0.20.0100.00817.41
8.0.10.0040.00416.89
8.0.00.0090.00816.78
7.4.330.0000.00515.09
7.4.320.0040.00416.53
7.4.300.0040.00416.59
7.4.290.0040.00416.49
7.4.280.0000.00816.65
7.4.270.0040.00316.60
7.4.260.0070.00016.49
7.4.250.0040.00416.50
7.4.240.0000.00716.61
7.4.230.0040.00416.61
7.4.220.0100.00616.56
7.4.210.0040.01116.57
7.4.200.0030.00316.59
7.4.160.0060.01016.34
7.4.150.0050.01517.40
7.4.140.0090.01117.86
7.4.130.0100.01516.41
7.4.120.0110.00516.52
7.4.110.0150.00316.58
7.4.100.0100.01016.49
7.4.90.0120.00616.57
7.4.80.0060.01119.39
7.4.70.0150.00716.58
7.4.60.0030.01416.58
7.4.50.0050.00016.31
7.4.40.0090.00916.47
7.4.30.0040.01316.56
7.4.00.0100.00415.02
7.3.330.0060.00013.19
7.3.320.0020.00313.21
7.3.310.0030.00316.33
7.3.300.0000.00616.38
7.3.290.0020.01416.22
7.3.280.0120.00616.31
7.3.270.0120.00617.40
7.3.260.0210.00316.43
7.3.250.0070.01116.39
7.3.240.0080.00916.58
7.3.230.0090.01316.39
7.3.210.0080.01116.55
7.3.200.0130.00819.39
7.3.190.0030.01316.34
7.3.180.0060.00916.61
7.3.170.0140.00316.31
7.3.160.0110.00516.54
7.2.330.0100.01316.44
7.2.320.0070.01016.78
7.2.310.0040.01316.88
7.2.300.0080.00816.62
7.2.290.0070.01016.59
7.2.00.0000.01219.11
7.1.100.0030.01018.09
7.1.70.0060.00616.92
7.1.60.0100.01319.59
7.1.50.0100.01316.97
7.1.00.0030.07322.32
7.0.200.0030.00516.87
7.0.60.0070.08020.03
7.0.50.0100.06717.89
7.0.40.0100.03720.04
7.0.30.0470.05720.13
7.0.20.0270.07720.00
7.0.10.0370.07020.34
7.0.00.0130.08020.01
5.6.280.0070.07021.16
5.6.210.0030.04320.52
5.6.200.0030.06318.13
5.6.190.0070.06320.33
5.6.180.3400.04020.41
5.6.170.0330.07320.42
5.6.160.0030.04020.44
5.6.150.0030.08318.15
5.6.140.0070.05318.12
5.6.130.0100.07718.12
5.6.120.0030.06321.15
5.6.110.0100.08021.00
5.6.100.0070.07320.97
5.6.90.0030.04320.95
5.6.80.0130.07020.52
5.6.70.4400.04720.51
5.5.350.0230.07720.42
5.5.340.0130.08317.93
5.5.330.0130.08320.25
5.5.320.0330.08020.30
5.5.310.0300.07320.21
5.5.300.0070.05017.98
5.5.290.0100.07717.91
5.5.280.0070.08020.88
5.5.270.0000.08020.85
5.5.260.0000.08320.88
5.5.250.0100.03320.50
5.5.240.0130.07720.24
5.4.450.0100.06319.11
5.4.440.0800.04719.52
5.4.430.0770.05019.13
5.4.420.0700.05019.36
5.4.410.0730.07719.47
5.4.400.0770.06719.25
5.4.390.0930.04319.06
5.4.380.0700.04718.88
5.4.370.0930.06319.16
5.4.360.0800.06018.81
5.4.350.0970.06319.13
5.4.340.1030.07019.25
5.4.320.0900.06019.16
5.4.310.0730.06719.10
5.4.300.1030.06019.09
5.4.290.0830.06319.25
5.4.280.0930.06019.11
5.4.270.0870.06019.05
5.4.260.0630.04719.19
5.4.250.0870.06019.15
5.4.240.0730.06319.15
5.4.230.1200.04719.09
5.4.220.1030.06319.09
5.4.210.0900.06318.93
5.4.200.0930.05716.74
5.4.190.1030.06318.93
5.4.180.1100.05318.86
5.4.170.0930.07018.92
5.4.160.0530.07018.99
5.4.150.0770.05319.09
5.4.140.0830.05016.37
5.4.130.0770.05016.27
5.4.120.0770.04716.45
5.4.110.0900.04316.35
5.4.100.0500.07016.22
5.4.90.0800.05016.21
5.4.80.0700.05016.40
5.4.70.0500.06716.20
5.4.60.0530.06016.20
5.4.50.0570.05316.15
5.4.40.0630.05016.16
5.4.30.0700.05016.33
5.4.20.0700.05016.46
5.4.10.0670.06316.21
5.4.00.0570.05015.79
5.3.290.0930.07014.54
5.3.280.0670.05714.44
5.3.270.0730.05014.59
5.3.260.0970.05314.41
5.3.250.0670.05714.56
5.3.240.0670.05714.57
5.3.230.1000.04014.41
5.3.220.0770.07014.53
5.3.210.0970.07014.55
5.3.200.0970.06314.38
5.3.190.0700.07714.37
5.3.180.0870.05014.42
5.3.170.0870.05014.47
5.3.160.0830.06314.38
5.3.150.0570.05714.41
5.3.140.0770.07714.52
5.3.130.0730.07314.36
5.3.120.0830.05314.40
5.3.110.1070.05714.53
5.3.100.0970.05313.83
5.3.90.1170.06313.88
5.3.80.1000.06013.81
5.3.70.1100.06714.01
5.3.60.1070.06313.98
5.3.50.1000.05013.90
5.3.40.0930.05313.79
5.3.30.1070.05313.74
5.3.20.1100.07313.50
5.3.10.1070.05713.53
5.3.00.0730.04713.44
5.2.170.0500.04711.12
5.2.160.0670.04711.01
5.2.150.0670.04011.03
5.2.140.0600.04710.95
5.2.130.0600.03710.96
5.2.120.0730.04711.16
5.2.110.0500.04011.16
5.2.100.0570.05010.90
5.2.90.0530.04011.06
5.2.80.0630.05010.93
5.2.70.0630.04310.86
5.2.60.0330.05310.93
5.2.50.0530.05310.87
5.2.40.0500.06010.80
5.2.30.0870.04710.79
5.2.20.0700.03310.81
5.2.10.0730.04010.97
5.2.00.0670.05310.83
5.1.60.0800.0309.95
5.1.50.0630.0339.93
5.1.40.0730.05710.09
5.1.30.0770.05010.20
5.1.20.0500.05010.29
5.1.10.0600.05010.17
5.1.00.0770.04710.11
5.0.50.0400.0278.51
5.0.40.0370.0338.37
5.0.30.0200.0608.29
5.0.20.0300.0378.08
5.0.10.0330.0278.22
5.0.00.0370.0408.28
4.4.90.0270.0305.79
4.4.80.0270.0175.89
4.4.70.0400.0135.87
4.4.60.0170.0275.89
4.4.50.0330.0235.94
4.4.40.0300.0435.77
4.4.30.0270.0275.89
4.4.20.0370.0205.83
4.4.10.0300.0305.84
4.4.00.0200.0405.87
4.3.110.0230.0275.71
4.3.100.0400.0275.76
4.3.90.0200.0205.79
4.3.80.0170.0375.68
4.3.70.0330.0205.77
4.3.60.0230.0275.81
4.3.50.0270.0305.70
4.3.40.0230.0475.75
4.3.30.0200.0304.45
4.3.20.0100.0274.56
4.3.10.0130.0304.49
4.3.00.0000.01315.42

preferences:
32.8 ms | 401 KiB | 5 Q