3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isEmptyArray($item) { if (is_array($item)) { return array_filter($item, 'isEmptyArray'); } if (!empty($item) || $item === "0") { return true; } return false; } function removeEmptyArrays($array) { $filteredArray = array_filter($array, 'isEmptyArray'); return $filteredArray; } $string='client_no=3286868&auth_key=K6htqteKvAFpJE4qaE655hTQRSVN9PGU&rest_call=create_acct_complete_m&billing_group[billing_group_row][0][billing_group_name]=&billing_group[billing_group_row][0][billing_group_description]=&billing_group[billing_group_row][0][client_billing_group_id]=&billing_group[billing_group_row][0][billing_group_idx]=&billing_group[billing_group_row][0][notify_method]=&billing_group[billing_group_row][0][notify_template_group]=&billing_group[billing_group_row][0][statement_template]='; parse_str($string, $output); $options = array(); $apiLiveOptions = array(); foreach ($output AS $key => $value) { if (is_array($value)) { if (!empty($value[$key])) { $options[$key] = $value; $apiLiveOptions[$key] = $value; } else { $array = array(); $apiLiveArray = array(); foreach ($value as $k => $v) { if(!empty($v[$k])) { $array[] = $value[$k]; $apiLiveArray[] = $value[$k]; $options[$key] = $array; } else { $newArray = array_filter($v, 'isEmptyArray'); $apiLiveArray[$k] = $newArray; foreach($newArray as $row => $column) { if(is_array($column)) { foreach($column as $r=>$c) { if($cat=='admintools-api') { if(isMultiDimensional($c) || (array_keys($c)[0] != $row.'s' ) ){ $options[$key][$k][$row][$r]=$c; } else { $options[$key][$k][$row][$r]=array_values($c)[0]; } } else { $options[$row][$r]=$c; } } } else { if($cat=='admintools-api') { $key == $row ? $options[$key][$k] = $column : $options[$key][$k][$row] = $column; } else { $array[$k]=$column; $options[$row] = $array; } } } } } $apiLiveOptions[$key] = $apiLiveArray; } } else { $options[$key] = $value; $apiLiveOptions[$key] = $value; } }; var_dump($options); ?>

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.0150.00616.88
8.3.50.0150.00321.11
8.3.40.0110.00418.83
8.3.30.0110.00318.67
8.3.20.0040.00420.21
8.3.10.0070.00023.54
8.3.00.0050.00323.60
8.2.180.0150.00018.17
8.2.170.0090.00618.84
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0030.00519.95
8.2.120.0070.00026.35
8.2.110.0030.00622.32
8.2.100.0040.00817.93
8.2.90.0000.00819.20
8.2.80.0030.00718.02
8.2.70.0030.00617.61
8.2.60.0080.00018.04
8.2.50.0040.00418.07
8.2.40.0040.00420.61
8.2.30.0000.00920.65
8.2.20.0000.00717.85
8.2.10.0000.00818.05
8.2.00.0070.00018.23
8.1.280.0140.00325.92
8.1.270.0040.00423.66
8.1.260.0040.00428.09
8.1.250.0000.00828.09
8.1.240.0060.00322.46
8.1.230.0040.00819.18
8.1.220.0050.00317.78
8.1.210.0000.00918.77
8.1.200.0060.00317.25
8.1.190.0040.00417.35
8.1.180.0030.00718.10
8.1.170.0050.00318.66
8.1.160.0040.00420.73
8.1.150.0040.00418.95
8.1.140.0000.00819.53
8.1.130.0000.00717.66
8.1.120.0070.00017.45
8.1.110.0040.00417.48
8.1.100.0030.00517.49
8.1.90.0040.00417.45
8.1.80.0040.00417.46
8.1.70.0000.00717.38
8.1.60.0050.00517.66
8.1.50.0000.00817.59
8.1.40.0070.00017.54
8.1.30.0000.00817.64
8.1.20.0000.00717.57
8.1.10.0040.00417.57
8.1.00.0050.00317.54
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0040.00418.46
8.0.270.0070.00017.34
8.0.260.0000.00617.23
8.0.250.0000.00717.01
8.0.240.0030.00316.93
8.0.230.0070.00016.97
8.0.220.0000.00716.93
8.0.210.0070.00016.88
8.0.200.0050.00317.02
8.0.190.0030.00516.88
8.0.180.0000.00916.93
8.0.170.0000.00716.83
8.0.160.0000.00716.88
8.0.150.0040.00416.78
8.0.140.0000.00716.88
8.0.130.0030.00313.34
8.0.120.0040.00416.80
8.0.110.0000.00816.91
8.0.100.0000.00716.73
8.0.90.0040.00416.96
8.0.80.0100.01016.97
8.0.70.0030.00616.91
8.0.60.0070.00016.80
8.0.50.0000.00816.91
8.0.30.0080.01117.32
8.0.20.0120.01117.40
8.0.10.0050.00216.92
8.0.00.0120.00716.78
7.4.330.0000.00616.78
7.4.320.0000.00616.52
7.4.300.0000.00616.54
7.4.290.0030.00316.57
7.4.280.0000.01016.50
7.4.270.0030.00516.52
7.4.260.0000.00716.50
7.4.250.0040.00416.57
7.4.240.0030.00316.62
7.4.230.0030.00316.50
7.4.220.0120.00916.46
7.4.210.0050.01216.56
7.4.200.0030.00316.41
7.4.160.0080.00816.33
7.4.150.0060.01917.40
7.4.140.0100.01017.86
7.4.130.0090.00716.57
7.4.120.0130.00616.50
7.4.110.0060.01216.46
7.4.100.0090.00916.65
7.4.90.0160.00616.41
7.4.80.0150.00619.39
7.4.70.0040.01216.35
7.4.60.0070.01016.39
7.4.50.0070.01016.29
7.4.40.0100.01016.56
7.4.30.0120.01216.58
7.4.00.0120.00315.05
7.3.330.0030.00313.20
7.3.320.0030.00313.24
7.3.310.0000.00816.27
7.3.300.0000.00716.32
7.3.290.0050.00216.38
7.3.280.0100.00916.33
7.3.270.0090.00917.40
7.3.260.0080.01516.46
7.3.250.0100.01016.40
7.3.240.0100.00716.40
7.3.230.0040.01216.52
7.3.210.0100.00716.36
7.3.200.0130.00319.39
7.3.190.0070.01016.55
7.3.180.0110.00716.36
7.3.170.0060.01116.56
7.3.160.0090.00916.44
7.2.330.0070.01016.68
7.2.320.0120.00916.46
7.2.310.0080.00816.70
7.2.300.0130.00316.55
7.2.290.0150.00616.68
7.1.70.0040.00417.21
7.1.60.0110.01419.27
7.1.50.0100.01316.70
7.1.00.0030.07322.48
7.0.200.0060.00316.78
7.0.60.0100.07321.84
7.0.50.0030.04317.98
7.0.40.0030.07320.30
7.0.30.0170.04020.10
7.0.20.0200.04720.12
7.0.10.0100.09020.25
7.0.00.0100.03720.18
5.6.280.0100.04021.14
5.6.210.0200.07020.63
5.6.200.0030.06718.22
5.6.190.0130.06320.48
5.6.180.0270.04020.48
5.6.170.0370.06320.62
5.6.160.0100.06320.46
5.6.150.0000.05718.25
5.6.140.0070.05018.21
5.6.130.0100.06318.18
5.6.120.0070.05021.00
5.6.110.0070.08320.95
5.6.100.0070.05020.97
5.6.90.0070.05320.98
5.6.80.0070.06320.43
5.5.350.0070.08720.50
5.5.340.0130.07318.05
5.5.330.0070.08020.25
5.5.320.0200.04020.36
5.5.310.0200.04020.50
5.5.300.0070.08017.99
5.5.290.0000.06718.04
5.5.280.0070.04020.79
5.5.270.0030.09020.90
5.5.260.0100.08320.89
5.5.250.0030.04320.71
5.5.240.0100.08020.29

preferences:
49.82 ms | 401 KiB | 5 Q