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; } function isMultiDimensional($array) { if(is_array($array)) { foreach ($array as $key=>$value){ if(is_array($value)){ return true; } } } return false; } $options_array = array("acct"=>array("acct_row"=>array("billing_group"=> array ("billing_group_row"=> array ('0' => array("billing_group_name"=>"", "billing_group_description"=> "", "list_start_master_file"=> "0" )))))); $options = array(); $apiLiveOptions = array(); foreach ($options_array 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, 'removeEmptyArrays'); $apiLiveArray[$k] = $newArray; foreach($newArray as $row => $column) { if(is_array($column)) { var_dump($column); foreach($column as $r=>$c) { $options[$row][$r]=$c; } } else { $array[$k]=$column; $options[$row] = $array; } } } } $apiLiveOptions[$key] = $apiLiveArray; } } else { $options[$key] = $value; $apiLiveOptions[$key] = $value; } }; ?>

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.0070.01116.75
8.3.50.0100.01021.14
8.3.40.0150.00018.79
8.3.30.0070.00718.71
8.3.20.0080.00020.33
8.3.10.0040.00423.65
8.3.00.0040.00423.48
8.2.180.0180.00316.75
8.2.170.0160.00318.90
8.2.160.0110.00422.96
8.2.150.0000.00825.66
8.2.140.0040.00424.66
8.2.130.0000.00819.83
8.2.120.0080.00026.35
8.2.110.0070.00322.13
8.2.100.0050.00517.93
8.2.90.0040.00419.34
8.2.80.0050.00318.04
8.2.70.0030.00617.63
8.2.60.0040.00417.93
8.2.50.0000.00918.07
8.2.40.0070.00020.29
8.2.30.0030.00519.49
8.2.20.0080.00017.80
8.2.10.0040.00418.02
8.2.00.0080.00018.07
8.1.280.0070.00725.92
8.1.270.0000.00822.19
8.1.260.0070.00328.09
8.1.250.0000.01028.09
8.1.240.0030.00723.81
8.1.230.0090.00318.94
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0040.00417.48
8.1.190.0060.00317.23
8.1.180.0000.01018.10
8.1.170.0000.00818.59
8.1.160.0000.00720.68
8.1.150.0020.00518.77
8.1.140.0030.00519.58
8.1.130.0030.00317.78
8.1.120.0040.00417.50
8.1.110.0000.00717.50
8.1.100.0040.00417.51
8.1.90.0040.00417.46
8.1.80.0040.00417.49
8.1.70.0030.00317.41
8.1.60.0040.00417.62
8.1.50.0090.00017.50
8.1.40.0030.00617.48
8.1.30.0050.00317.63
8.1.20.0060.00317.62
8.1.10.0000.00717.55
8.1.00.0040.00417.48
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0030.00318.45
8.0.270.0070.00017.26
8.0.260.0030.00617.17
8.0.250.0050.00217.00
8.0.240.0000.00716.85
8.0.230.0000.00716.83
8.0.220.0040.00416.78
8.0.210.0020.00516.83
8.0.200.0030.00316.95
8.0.190.0080.00016.99
8.0.180.0050.00316.75
8.0.170.0050.00316.95
8.0.160.0030.00316.89
8.0.150.0070.00016.84
8.0.140.0040.00416.75
8.0.130.0030.00313.29
8.0.120.0080.00016.97
8.0.110.0090.00016.74
8.0.100.0070.00016.84
8.0.90.0030.00516.77
8.0.80.0080.00816.78
8.0.70.0040.00416.93
8.0.60.0040.00416.80
8.0.50.0030.00516.88
8.0.30.0130.00617.17
8.0.20.0120.01017.42
8.0.10.0070.00017.00
8.0.00.0130.00516.69
7.4.330.0020.00216.89
7.4.320.0030.00316.56
7.4.300.0030.00316.40
7.4.290.0000.00716.59
7.4.280.0070.00316.58
7.4.270.0070.00016.65
7.4.260.0000.00716.63
7.4.250.0000.00716.61
7.4.240.0060.00216.53
7.4.230.0040.00416.41
7.4.220.0130.00316.62
7.4.210.0080.01016.59
7.4.200.0030.00316.67
7.4.160.0110.00416.42
7.4.150.0130.00617.40
7.4.140.0090.01117.86
7.4.130.0060.01216.59
7.4.120.0120.00916.60
7.4.110.0120.00616.54
7.4.100.0120.00616.49
7.4.90.0100.00716.49
7.4.80.0030.01419.39
7.4.70.0140.00316.49
7.4.60.0110.00716.50
7.4.50.0000.01516.39
7.4.40.0070.01416.57
7.4.30.0070.01016.68
7.4.00.0090.00915.01
7.3.330.0020.00413.33
7.3.320.0050.00013.31
7.3.310.0040.00416.31
7.3.300.0020.00516.34
7.3.290.0040.00416.30
7.3.280.0080.01216.39
7.3.270.0040.01617.40
7.3.260.0100.00716.35
7.3.250.0080.01216.40
7.3.240.0080.01316.53
7.3.230.0100.00716.65
7.3.210.0090.00816.49
7.3.200.0180.00319.39
7.3.190.0080.00816.50
7.3.180.0060.01016.65
7.3.170.0120.00916.68
7.3.160.0160.00016.39
7.2.330.0160.00316.71
7.2.320.0150.00316.92
7.2.310.0030.01316.82
7.2.300.0050.01116.54
7.2.290.0080.00816.58
7.2.00.0060.00919.43
7.1.100.0130.00017.83
7.1.70.0050.00317.25
7.1.60.0040.01819.27
7.1.50.0110.01417.10
7.1.00.0030.07722.54
7.0.200.0030.00716.68
7.0.60.0070.07021.83
7.0.50.0030.07717.96
7.0.40.0030.06020.30
7.0.30.0330.04720.21
7.0.20.0370.07720.12
7.0.10.0000.06320.35
7.0.00.0000.04720.03
5.6.280.0000.03721.14
5.6.210.0070.04720.51
5.6.200.0000.04718.18
5.6.190.0030.04320.50
5.6.180.0330.08320.50
5.6.170.0330.05720.47
5.6.160.0030.08720.46
5.6.150.0170.07318.23
5.6.140.0070.08718.15
5.6.130.0030.08718.19
5.6.120.0070.04021.00
5.6.110.0100.06321.09
5.6.100.0130.07321.10
5.6.90.0170.05020.99
5.6.80.0070.08320.50
5.5.350.0100.08320.42
5.5.340.0100.07717.98
5.5.330.0000.05020.44
5.5.320.0330.06720.24
5.5.310.0330.07720.23
5.5.300.0070.04718.08
5.5.290.0030.07717.94
5.5.280.0100.06020.82
5.5.270.0170.07320.89
5.5.260.0100.08020.88
5.5.250.0100.08020.72
5.5.240.0100.03720.17

preferences:
42.48 ms | 401 KiB | 5 Q