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) { if(is_array($column)) { foreach($column as $r=>$c) { $rowObjectExample .= $k.'_row '.$k.'Row'; $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.40.0070.00718.65
8.3.30.0110.00419.07
8.3.20.0080.00020.33
8.3.10.0070.00021.90
8.3.00.0040.00417.63
8.2.170.0070.00722.96
8.2.160.0100.00320.41
8.2.150.0070.00025.66
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0080.00020.80
8.2.110.0090.00020.99
8.2.100.0000.01017.91
8.2.90.0000.00817.87
8.2.80.0090.00017.97
8.2.70.0040.00417.75
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0000.00717.97
8.2.30.0050.00218.13
8.2.20.0050.00217.76
8.2.10.0000.00818.03
8.2.00.0080.00018.05
8.1.270.0080.00020.33
8.1.260.0040.00426.35
8.1.250.0000.00928.09
8.1.240.0080.00320.75
8.1.230.0070.00421.03
8.1.220.0080.00017.74
8.1.210.0050.00319.04
8.1.200.0090.00017.38
8.1.190.0030.00517.10
8.1.180.0020.00518.10
8.1.170.0040.00418.71
8.1.160.0000.00722.11
8.1.150.0070.00018.82
8.1.140.0000.00917.50
8.1.130.0000.00717.71
8.1.120.0050.00217.48
8.1.110.0030.00317.46
8.1.100.0040.00417.46
8.1.90.0080.00017.45
8.1.80.0050.00217.46
8.1.70.0060.00317.33
8.1.60.0000.00817.48
8.1.50.0040.00817.57
8.1.40.0060.00317.39
8.1.30.0090.00017.61
8.1.20.0000.00817.65
8.1.10.0000.00817.46
8.1.00.0000.00817.43
8.0.300.0050.00219.98
8.0.290.0070.00016.75
8.0.280.0030.00318.33
8.0.270.0000.00817.23
8.0.260.0000.00617.18
8.0.250.0030.00317.03
8.0.240.0030.00617.00
8.0.230.0040.00416.80
8.0.220.0000.00716.86
8.0.210.0000.00816.84
8.0.200.0000.00716.88
8.0.190.0090.00016.96
8.0.180.0000.00716.99
8.0.170.0050.00316.94
8.0.160.0030.00616.77
8.0.150.0040.00416.86
8.0.140.0050.00216.91
8.0.130.0000.00513.38
8.0.120.0040.00416.75
8.0.110.0050.00316.95
8.0.100.0000.00716.94
8.0.90.0000.00716.68
8.0.80.0040.02016.99
8.0.70.0040.00416.74
8.0.60.0050.00216.86
8.0.50.0040.00416.86
8.0.30.0050.01217.14
8.0.20.0110.00817.40
8.0.10.0000.00717.07
8.0.00.0120.00716.74
7.4.330.0030.00315.15
7.4.320.0000.00616.58
7.4.300.0030.00316.43
7.4.290.0000.00716.55
7.4.280.0070.00016.42
7.4.270.0070.00016.51
7.4.260.0000.00716.62
7.4.250.0050.00316.39
7.4.240.0050.00216.62
7.4.230.0040.00416.40
7.4.220.0090.00916.68
7.4.210.0110.00316.63
7.4.200.0000.00716.46
7.4.160.0060.01016.70
7.4.150.0030.01317.40
7.4.140.0110.00817.86
7.4.130.0140.00516.59
7.4.120.0090.00716.50
7.4.110.0070.01116.63
7.4.100.0110.01416.63
7.4.90.0140.00616.41
7.4.80.0090.00919.39
7.4.70.0190.00316.51
7.4.60.0060.01016.31
7.4.50.0030.00316.27
7.4.40.0030.01416.66
7.4.30.0080.00716.55
7.4.00.0090.00314.87
7.3.330.0060.00013.26
7.3.320.0000.00613.11
7.3.310.0070.00016.21
7.3.300.0030.00316.28
7.3.290.0080.00716.29
7.3.280.0110.00916.26
7.3.270.0060.01217.40
7.3.260.0090.01216.59
7.3.250.0150.00416.40
7.3.240.0070.01416.69
7.3.230.0090.01216.39
7.3.210.0190.00316.34
7.3.200.0160.00319.39
7.3.190.0060.01216.63
7.3.180.0040.01116.07
7.3.170.0070.01416.57
7.3.160.0150.00316.40
7.2.330.0160.00716.43
7.2.320.0090.00916.47
7.2.310.0100.00716.40
7.2.300.0040.01316.30
7.2.290.0070.01016.68
7.2.00.0030.01319.50
7.1.100.0070.00718.28
7.1.70.0030.00617.21
7.1.60.0090.01519.59
7.1.50.0100.01416.68
7.1.00.0130.06322.28
7.0.200.0040.00416.80
7.0.110.0400.07319.99
7.0.100.0470.07319.94
7.0.90.0600.05020.04
7.0.80.0530.06319.92
7.0.70.0570.07019.91
7.0.60.0630.06719.94
7.0.50.0500.08320.45
7.0.40.0070.08020.13
7.0.30.0100.05320.05
7.0.20.0130.07020.06
7.0.10.0070.08719.99
7.0.00.0100.08020.03
5.6.280.0130.06320.79
5.6.250.0130.07320.75
5.6.240.0070.09320.65
5.6.230.0130.09320.55
5.6.220.0070.07720.86
5.6.210.0070.05320.69
5.6.200.0170.08021.14
5.6.190.0230.07021.16
5.6.180.0070.08021.28
5.6.170.0070.08721.28
5.6.160.0130.04721.06
5.6.150.0030.08721.10
5.6.140.0070.08021.16
5.6.130.0100.08321.09
5.6.120.0100.08321.06
5.6.110.0170.07021.14
5.6.100.0070.08721.04
5.6.90.0130.03721.07
5.6.80.0200.06020.65
5.6.70.0070.08020.50
5.6.60.0070.07720.46
5.6.50.0070.07720.58
5.6.40.0070.05320.42
5.6.30.0130.03020.49
5.6.20.0100.08020.58
5.6.10.0170.07720.44
5.6.00.0100.07320.56
5.5.380.0070.08020.48
5.5.370.0070.07720.39
5.5.360.0200.07320.38
5.5.350.0070.07020.44
5.5.340.0130.07320.71
5.5.330.0130.08021.03
5.5.320.0200.07320.82
5.5.310.0030.08020.96
5.5.300.0200.06720.96
5.5.290.0030.08720.82
5.5.280.0170.06720.92
5.5.270.0100.07720.90
5.5.260.0000.05320.96
5.5.250.0100.07720.77
5.5.240.0070.07320.10
5.5.230.0070.08020.20
5.5.220.0130.07320.40
5.5.210.0100.07720.27
5.5.200.0170.07320.34
5.5.190.0100.07720.06
5.5.180.0030.08320.25
5.5.160.0070.08020.31
5.5.150.0170.06320.34
5.5.140.0130.07720.32
5.5.130.0130.07720.33
5.5.120.0130.06320.26
5.5.110.0100.07720.16
5.5.100.0100.07720.18
5.5.90.0030.08020.09
5.5.80.0100.06020.24
5.5.70.0230.06020.00
5.5.60.0070.07720.20
5.5.50.0030.07720.25
5.5.40.0070.03719.98
5.5.30.0130.06720.20
5.5.20.0030.07720.16
5.5.10.0030.08020.12
5.5.00.0100.04320.14
5.4.450.0100.07019.38
5.4.440.0100.06719.44
5.4.430.0070.08319.48
5.4.420.0070.06719.30
5.4.410.0100.06719.31
5.4.400.0100.07319.04
5.4.390.0030.06718.95
5.4.380.0070.05719.11
5.4.370.0170.06719.13
5.4.360.0170.06019.18
5.4.350.0000.04319.13
5.4.340.0170.07319.12
5.4.320.0030.07319.07
5.4.310.0130.06718.95
5.4.300.0130.04019.07
5.4.290.0070.05718.93
5.4.280.0030.08319.00
5.4.270.0200.06719.09
5.4.260.0070.07719.11
5.4.250.0130.06019.28
5.4.240.0100.06018.95
5.4.230.0130.06718.94
5.4.220.0070.07018.95
5.4.210.0100.04019.00
5.4.200.0070.06718.95
5.4.190.0030.06718.94
5.4.180.0030.03719.15
5.4.170.0070.05018.95
5.4.160.0130.05019.00
5.4.150.0030.07319.05
5.4.140.0030.07316.48
5.4.130.0000.06716.21
5.4.120.0100.05016.23
5.4.110.0070.07716.52
5.4.100.0100.06016.53
5.4.90.0070.06716.51
5.4.80.0100.06716.34
5.4.70.0070.07316.51
5.4.60.0170.05716.26
5.4.50.0130.05016.34
5.4.40.0030.07316.52
5.4.30.0200.05716.20
5.4.20.0030.06716.27
5.4.10.0000.08316.45
5.4.00.0100.07015.70
5.3.290.0070.07714.59
5.3.280.0070.07314.54
5.3.270.0070.08014.64
5.3.260.0070.07314.54
5.3.250.0100.07014.56
5.3.240.0030.06714.49
5.3.230.0070.06314.50
5.3.220.0030.05314.51
5.3.210.0070.06014.58
5.3.200.0100.07014.53
5.3.190.0000.05714.46
5.3.180.0130.06714.42
5.3.170.0070.06714.59
5.3.160.0200.06314.60
5.3.150.0070.06714.58
5.3.140.0170.06314.59
5.3.130.0130.07014.50
5.3.120.0000.06014.44
5.3.110.0030.04714.51
5.3.100.0030.06014.07
5.3.90.0070.03314.14
5.3.80.0070.06714.05
5.3.70.0070.06314.11
5.3.60.0100.07013.88
5.3.50.0030.06313.90
5.3.40.0030.05013.84
5.3.30.0100.06714.00
5.3.20.0070.06713.60
5.3.10.0100.05713.57
5.3.00.0070.07713.52
5.2.170.0100.06011.16
5.2.160.0170.03011.18
5.2.150.0070.05711.09
5.2.140.0070.05711.07
5.2.130.0100.03011.01
5.2.120.0000.07011.05
5.2.110.0030.06311.04
5.2.100.0030.05011.06
5.2.90.0030.06011.14
5.2.80.0030.06311.02
5.2.70.0030.06311.05
5.2.60.0100.05010.96
5.2.50.0100.06310.96
5.2.40.0070.06310.91
5.2.30.0100.05010.93
5.2.20.0030.06311.04
5.2.10.0000.06010.84
5.2.00.0130.05310.96
5.1.60.0030.0539.83
5.1.50.0030.05310.01
5.1.40.0030.05710.05
5.1.30.0000.05310.36
5.1.20.0030.06010.36
5.1.10.0070.05310.16
5.1.00.0100.05010.06
5.0.50.0000.0478.55
5.0.40.0000.0478.43
5.0.30.0030.0508.25
5.0.20.0030.0308.28
5.0.10.0030.0438.27
5.0.00.0000.0678.36
4.4.90.0030.0337.91
4.4.80.0000.0277.91
4.4.70.0000.0207.91
4.4.60.0030.0307.91
4.4.50.0000.0377.91
4.4.40.0100.0477.91
4.4.30.0070.0307.91
4.4.20.0070.0337.93
4.4.10.0030.0337.93
4.4.00.0000.0537.93
4.3.110.0030.0337.93
4.3.100.0070.0277.93
4.3.90.0070.0307.93
4.3.80.0000.0407.93
4.3.70.0030.0177.93
4.3.60.0070.0307.93
4.3.50.0000.0377.93
4.3.40.0000.0537.93
4.3.30.0000.0377.93
4.3.20.0000.0237.93
4.3.10.0000.0337.93
4.3.00.0070.0307.93

preferences:
57.16 ms | 400 KiB | 5 Q