3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 'a' => 'a', 'b' => null, 'c' => array( 'a' => null, 'b' => 'b', ), 'd' => array( 'a' => null ) ); $result = array_walk_recursive_delete($array, function ($value, $key) { if (is_array($value)) { return empty($value); } }); echo"<pre>"; print_r($result); echo"<pre>"; function array_walk_recursive_delete(array &$array, callable $callback) { foreach ($array as $key => &$value) { if (is_array($value)) { $value = array_walk_recursive_delete($value, $callback); } if ($value == null) { unset($array[$key]); } } return $array; }

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.0040.01118.43
8.3.50.0120.00922.85
8.3.40.0040.01118.71
8.3.30.0000.01419.13
8.3.20.0070.00020.18
8.3.10.0040.00421.60
8.3.00.0050.00319.02
8.2.180.0220.00018.54
8.2.170.0040.01119.09
8.2.160.0120.00322.96
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00420.99
8.2.110.0060.00320.95
8.2.100.0090.00317.72
8.2.90.0050.00317.84
8.2.80.0080.00019.39
8.2.70.0000.00818.16
8.2.60.0000.00917.63
8.2.50.0000.00718.16
8.2.40.0040.00422.15
8.2.30.0040.00419.55
8.2.20.0030.00517.64
8.2.10.0020.00518.18
8.2.00.0050.00317.82
8.1.280.0140.00325.92
8.1.270.0100.00718.89
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0030.00622.64
8.1.230.0040.00821.04
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0080.00017.23
8.1.190.0030.00517.13
8.1.180.0000.00818.10
8.1.170.0030.00618.64
8.1.160.0000.00718.76
8.1.150.0080.00019.02
8.1.140.0040.00417.40
8.1.130.0070.00017.70
8.1.120.0040.00417.50
8.1.110.0050.00217.43
8.1.100.0030.00517.50
8.1.90.0080.00017.45
8.1.80.0070.00017.48
8.1.70.0040.00417.46
8.1.60.0060.00317.61
8.1.50.0040.00417.52
8.1.40.0000.00817.53
8.1.30.0000.00817.67
8.1.20.0040.00417.65
8.1.10.0040.00417.50
8.1.00.0080.00017.41
8.0.300.0000.00719.93
8.0.290.0040.00416.88
8.0.280.0070.00018.40
8.0.270.0000.00817.23
8.0.260.0060.00017.13
8.0.250.0040.00417.06
8.0.240.0000.00816.99
8.0.230.0030.00316.95
8.0.220.0030.00316.89
8.0.210.0040.00416.91
8.0.200.0060.00017.00
8.0.190.0060.00316.99
8.0.180.0040.00416.89
8.0.170.0070.00016.95
8.0.160.0050.00316.94
8.0.150.0000.00716.92
8.0.140.0050.00316.87
8.0.130.0060.00013.36
8.0.120.0080.00016.88
8.0.110.0000.00816.96
8.0.100.0040.00416.75
8.0.90.0070.00016.98
8.0.80.0100.00716.97
8.0.70.0040.00417.01
8.0.60.0000.00716.97
8.0.50.0050.00316.84
8.0.30.0140.00517.27
8.0.20.0110.01017.40
8.0.10.0040.00416.95
8.0.00.0100.01016.78
7.4.330.0030.00315.03
7.4.320.0030.00316.45
7.4.300.0000.00616.52
7.4.290.0020.00516.58
7.4.280.0080.00016.49
7.4.270.0000.00716.49
7.4.260.0000.00716.42
7.4.250.0040.00416.57
7.4.240.0040.00416.58
7.4.230.0040.00416.50
7.4.220.0120.00316.68
7.4.210.0120.00316.59
7.4.200.0030.00316.32
7.4.160.0090.00616.46
7.4.150.0090.00917.40
7.4.140.0070.01017.86
7.4.130.0110.00816.46
7.4.120.0080.00816.51
7.4.110.0070.01116.63
7.4.100.0120.00616.46
7.4.90.0100.00716.50
7.4.80.0140.00319.39
7.4.70.0090.00616.52
7.4.60.0070.01016.31
7.4.50.0030.00616.34
7.4.40.0110.00616.65
7.4.30.0140.00316.54
7.4.00.0070.01115.10
7.3.330.0050.00013.38
7.3.320.0030.00313.18
7.3.310.0000.00716.34
7.3.300.0000.00616.31
7.3.290.0100.00416.29
7.3.280.0070.01016.35
7.3.270.0130.00317.40
7.3.260.0060.01016.58
7.3.250.0150.00116.41
7.3.240.0170.00016.48
7.3.230.0120.00816.48
7.3.210.0070.01116.38
7.3.200.0090.00919.39
7.3.190.0110.01116.59
7.3.180.0100.00716.57
7.3.170.0060.01116.36
7.3.160.0040.01116.56
7.3.120.0030.01314.77
7.3.110.0000.01714.80
7.3.100.0040.01114.91
7.3.90.0090.00914.73
7.3.80.0060.00314.75
7.3.70.0140.00414.52
7.3.60.0040.01214.89
7.3.50.0040.01114.65
7.3.40.0040.01114.81
7.3.30.0040.01114.66
7.3.20.0060.00916.58
7.3.10.0000.01216.49
7.3.00.0090.00316.81
7.2.330.0100.00716.52
7.2.320.0150.00316.76
7.2.310.0130.01016.75
7.2.300.0040.01216.67
7.2.290.0090.00916.68
7.2.240.0030.01014.96
7.2.230.0120.00615.18
7.2.220.0030.01014.99
7.2.210.0120.00614.77
7.2.200.0070.00314.86
7.2.190.0040.01114.69
7.2.180.0030.00714.85
7.2.170.0070.00714.76
7.2.160.0090.00614.77
7.2.150.0030.00717.02
7.2.140.0100.00316.84
7.2.130.0030.01217.01
7.2.120.0070.00716.77
7.2.110.0090.00616.88
7.2.100.0040.00716.98
7.2.90.0030.01017.05
7.2.80.0100.00716.62
7.2.70.0100.00317.04
7.2.60.0050.00517.00
7.2.50.0000.01416.79
7.2.40.0070.01116.86
7.2.30.0000.01016.96
7.2.20.0060.00917.06
7.2.10.0100.00716.95
7.2.00.0040.00718.28
7.1.330.0030.01015.71
7.1.320.0100.00315.75
7.1.310.0040.01115.64
7.1.300.0080.00615.64
7.1.290.0060.00315.75
7.1.280.0030.01315.70
7.1.270.0060.00315.67
7.1.260.0000.01615.76
7.1.250.0030.00715.38
7.1.100.0030.01318.01
7.1.70.0040.00417.15
7.1.60.0140.01119.57
7.1.50.0000.02216.89
7.1.00.0100.07322.45
7.0.200.0000.00716.77
7.0.140.0070.06722.00
7.0.100.0070.07319.94
7.0.90.0370.06720.08
7.0.80.0300.06719.90
7.0.70.0200.03319.88
7.0.60.0100.08019.83
7.0.50.0030.06320.39
7.0.40.0070.08720.07
7.0.30.0100.08320.05
7.0.20.0200.06019.94
7.0.10.0030.07720.04
7.0.00.0100.08020.02
5.6.280.0000.07721.04
5.6.250.0130.07320.54
5.6.240.0100.08020.52
5.6.230.0130.08320.63
5.6.220.0030.06720.50
5.6.210.0100.08720.64
5.6.200.0070.08321.14
5.6.190.0070.04721.14
5.6.180.0030.09021.01
5.6.170.0100.05321.02
5.6.160.0070.08021.07
5.6.150.0100.07720.96
5.6.140.0000.09021.11
5.6.130.0100.06720.95
5.6.120.0100.07721.11
5.6.110.0070.04720.95
5.6.100.0070.08020.88
5.6.90.0070.09321.00
5.6.80.0070.04320.46
5.6.70.0070.08020.49
5.6.60.0130.05720.33
5.6.50.0100.06020.43
5.6.40.0100.07320.35
5.6.30.0100.07320.34
5.6.20.0070.08020.30
5.6.10.0170.07320.34
5.6.00.0100.07320.42
5.5.380.0070.08320.40
5.5.370.0130.08020.42
5.5.360.0230.06720.32
5.5.350.0130.05720.40
5.5.340.0170.03320.87
5.5.330.0070.06720.91
5.5.320.0100.05320.88
5.5.310.0070.08020.76
5.5.300.0100.07720.84
5.5.290.0000.08320.74
5.5.280.0070.07720.90
5.5.270.0000.07720.77
5.5.260.0030.06320.63
5.5.250.0070.09020.59
5.5.240.0070.04020.29
5.5.230.0030.08720.21
5.5.220.0070.06720.25
5.5.210.0130.07320.26
5.5.200.0070.08019.98
5.5.190.0030.08720.13
5.5.180.0030.08320.15
5.5.160.0100.07320.26
5.5.150.0100.07720.17
5.5.140.0100.07720.17
5.5.130.0170.07020.28
5.5.120.0030.08320.27
5.5.110.0000.08020.08
5.5.100.0030.05720.13
5.5.90.0000.07720.10
5.5.80.0070.08020.11
5.5.70.0100.07320.06
5.5.60.0170.07319.96
5.5.50.0030.08320.08
5.5.40.0030.04719.96
5.5.30.0070.07319.93
5.5.20.0100.08720.11
5.5.10.0100.08320.04
5.5.00.0070.08020.04
5.4.450.0130.05719.45
5.4.440.0170.05319.45
5.4.430.0100.07019.46
5.4.420.0030.08319.37
5.4.410.0100.08019.32
5.4.400.0070.07319.03
5.4.390.0030.07719.05
5.4.380.0100.07719.12
5.4.370.0200.06319.05
5.4.360.0070.07719.21
5.4.350.0100.07719.23
5.4.340.0030.04718.88
5.4.320.0130.06019.15
5.4.310.0130.06719.23
5.4.300.0030.08318.87
5.4.290.0030.07319.16
5.4.280.0030.07019.16
5.4.270.0170.06719.20
5.4.260.0070.08019.22
5.4.250.0070.07319.02
5.4.240.0130.07718.90
5.4.230.0030.07719.04
5.4.220.0230.05319.12
5.4.210.0030.08318.87
5.4.200.0070.06719.04
5.4.190.0070.08019.02
5.4.180.0030.07719.11
5.4.170.0100.07719.03
5.4.160.0070.07319.11
5.4.150.0070.07719.13
5.4.140.0030.06716.46
5.4.130.0070.06316.47
5.4.120.0070.05316.29
5.4.110.0070.05716.49
5.4.100.0100.07016.59
5.4.90.0100.06316.32
5.4.80.0000.04016.40
5.4.70.0100.07016.43
5.4.60.0070.06716.45
5.4.50.0070.07316.38
5.4.40.0030.07716.51
5.4.30.0030.08016.38
5.4.20.0070.03716.40
5.4.10.0100.06716.24
5.4.00.0070.05715.89
5.3.290.0000.08314.65
5.3.280.0030.05714.66
5.3.270.0070.06014.73
5.3.260.0030.07314.54
5.3.250.0100.06714.68
5.3.240.0070.07714.61
5.3.230.0030.08314.53
5.3.220.0100.07014.58
5.3.210.0100.07014.68
5.3.200.0030.08014.68
5.3.190.0130.06714.50
5.3.180.0130.04014.55
5.3.170.0100.05714.63
5.3.160.0070.08014.60
5.3.150.0030.05014.54
5.3.140.0170.06314.63
5.3.130.0030.08014.62
5.3.120.0070.06014.61
5.3.110.0030.07314.63
5.3.100.0130.03314.16
5.3.90.0130.06014.03
5.3.80.0070.07314.05
5.3.70.0070.04014.07
5.3.60.0000.04313.98
5.3.50.0100.07014.05
5.3.40.0000.04713.97
5.3.30.0030.08014.03
5.3.20.0070.07013.71
5.3.10.0030.07313.66
5.3.00.0070.07013.54
5.2.170.0030.05011.58
5.2.160.0070.05711.58
5.2.150.0070.06311.58
5.2.140.0070.06311.58
5.2.130.0100.05711.58
5.2.120.0100.03711.58
5.2.110.0070.05311.58
5.2.100.0100.03711.58
5.2.90.0000.06011.58
5.2.80.0100.06011.58
5.2.70.0070.06011.58
5.2.60.0130.03711.58
5.2.50.0030.04711.58
5.2.40.0030.06311.58
5.2.30.0070.06311.58
5.2.20.0100.05711.58
5.2.10.0030.04711.58
5.2.00.0130.04711.58
5.1.60.0030.05311.58
5.1.50.0000.03711.58
5.1.40.0000.03011.58
5.1.30.0070.05711.58
5.1.20.0130.05011.58
5.1.10.0000.04711.58
5.1.00.0030.04311.58
5.0.50.0070.04311.58
5.0.40.0030.04711.58
5.0.30.0030.05311.58
5.0.20.0000.04011.58
5.0.10.0030.03711.58
5.0.00.0000.06311.58
4.4.90.0070.02011.58
4.4.80.0070.03011.58
4.4.70.0100.02711.58
4.4.60.0000.03311.58
4.4.50.0000.03711.58
4.4.40.0000.05011.58
4.4.30.0030.03311.58
4.4.20.0030.03311.58
4.4.10.0070.01311.58
4.4.00.0000.06011.58
4.3.110.0030.02711.58
4.3.100.0070.01711.58
4.3.90.0070.03011.58
4.3.80.0030.04311.58
4.3.70.0070.02711.58
4.3.60.0030.03311.58
4.3.50.0030.02711.58
4.3.40.0030.04711.58
4.3.30.0000.03011.58
4.3.20.0000.02011.58
4.3.10.0000.03011.58
4.3.00.0070.03011.58

preferences:
61.51 ms | 401 KiB | 5 Q