3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array("A" => "aa", "B" => ["A" => "aaa", "B" => "bb"], "C" => "cc", "D" => ["E" =>"ee"]); function array_filter_recursive(array &$array, callable $callback) { foreach ($array as $key => &$value) { if ($callback($key, $value)) unset($array[$key]); else if (is_array($value)) array_filter_recursive($value, $callback); } } function sanitizedArray(&$arr, $restricted, $keys = false) { foreach($restricted as $val) { array_filter_recursive($arr, function($k, $v) use ($val, $keys) {return $keys ? ($val === $k) : ($val === $v);}); } } sanitizedArray($arr, ["A","E", "D"], true); print_r($arr);

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.0160.00316.50
8.3.50.0090.00918.35
8.3.40.0100.00718.72
8.3.30.0110.00318.66
8.3.20.0090.00021.90
8.3.10.0030.00519.18
8.3.00.0050.00321.90
8.2.180.0110.00718.06
8.2.170.0120.00322.96
8.2.160.0120.00322.16
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0050.00326.16
8.2.110.0100.00021.11
8.2.100.0090.00317.72
8.2.90.0060.00317.97
8.2.80.0080.00317.97
8.2.70.0030.00718.03
8.2.60.0000.00917.92
8.2.50.0000.00719.21
8.2.40.0000.00820.30
8.2.30.0000.00720.33
8.2.20.0040.00418.10
8.2.10.0040.00418.93
8.2.00.0000.00718.19
8.1.280.0110.00725.92
8.1.270.0040.00420.75
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00023.96
8.1.230.0060.00622.81
8.1.220.0060.00317.78
8.1.210.0030.00618.88
8.1.200.0060.00317.35
8.1.190.0040.00417.63
8.1.180.0000.00818.10
8.1.170.0030.00618.52
8.1.160.0050.00518.86
8.1.150.0070.00018.94
8.1.140.0000.00720.33
8.1.130.0040.00417.34
8.1.120.0000.00717.45
8.1.110.0040.00417.49
8.1.100.0040.00417.32
8.1.90.0040.00417.40
8.1.80.0040.00717.46
8.1.70.0070.00017.45
8.1.60.0000.00817.52
8.1.50.0040.00417.50
8.1.40.0040.00417.39
8.1.30.0000.00817.70
8.1.20.0080.00017.68
8.1.10.0030.00517.55
8.1.00.0040.00417.41
8.0.300.0020.00519.98
8.0.290.0040.00416.63
8.0.280.0080.00018.36
8.0.270.0040.00416.96
8.0.260.0070.00016.89
8.0.250.0070.00017.04
8.0.240.0040.00417.05
8.0.230.0040.00316.98
8.0.220.0030.00316.97
8.0.210.0000.00716.96
8.0.200.0000.00716.99
8.0.190.0070.00017.03
8.0.180.0070.00016.89
8.0.170.0040.00416.87
8.0.160.0000.00716.92
8.0.150.0040.00416.94
8.0.140.0000.00716.94
8.0.130.0030.00313.47
8.0.120.0040.00416.83
8.0.110.0020.00516.97
8.0.100.0000.00816.99
8.0.90.0030.00516.77
8.0.80.0100.01017.03
8.0.70.0080.00016.96
8.0.60.0050.00216.86
8.0.50.0020.00516.78
8.0.30.0040.01916.93
8.0.20.0060.01317.10
8.0.10.0000.00716.96
8.0.00.0090.00916.78
7.4.330.0020.00215.55
7.4.320.0030.00316.54
7.4.300.0030.00316.49
7.4.290.0040.00416.52
7.4.280.0050.00316.61
7.4.270.0060.00016.52
7.4.260.0080.00016.41
7.4.250.0000.00716.49
7.4.240.0050.00216.55
7.4.230.0040.00416.52
7.4.220.0000.00816.45
7.4.210.0080.00716.58
7.4.200.0050.00216.41
7.4.140.0090.00917.86
7.4.130.0110.00716.59
7.4.120.0070.01716.48
7.4.110.0110.00516.35
7.4.100.0060.01016.47
7.4.90.0090.00916.48
7.4.80.0070.01019.39
7.4.70.0090.01516.45
7.4.60.0080.00816.68
7.4.50.0040.01516.60
7.4.40.0110.00716.46
7.4.30.0130.00816.48
7.4.20.0160.00416.61
7.4.10.0090.00715.69
7.4.00.0080.00915.39
7.3.330.0060.00013.35
7.3.320.0030.00313.37
7.3.310.0000.00716.36
7.3.300.0000.00716.40
7.3.290.0000.00716.30
7.3.280.0060.01316.30
7.3.260.0110.00916.52
7.3.230.0070.01416.50
7.3.210.0060.01216.73
7.3.200.0070.01016.27
7.3.190.0100.00616.46
7.3.180.0080.00816.42
7.3.170.0150.00316.33
7.3.160.0140.00716.43
7.3.150.0160.00416.34
7.3.140.0090.01216.55
7.3.130.0050.01215.89
7.3.120.0090.01015.39
7.3.110.0050.01515.34
7.3.100.0090.00715.50
7.3.90.0090.00815.33
7.3.80.0070.01015.35
7.3.70.0070.00815.36
7.3.60.0050.00915.46
7.3.50.0070.01015.19
7.3.40.0100.00815.25
7.3.30.0080.00615.17
7.3.20.0070.01116.13
7.3.10.0100.00916.10
7.3.00.0100.00516.18
7.2.330.0120.00616.52
7.2.320.0140.00916.55
7.2.310.0030.01316.52
7.2.300.0090.00616.46
7.2.290.0160.00616.51
7.2.280.0090.01316.76
7.2.270.0090.01516.74
7.2.260.0080.01015.75
7.2.250.0080.01115.62
7.2.240.0090.01115.56
7.2.230.0100.00715.58
7.2.220.0050.00915.61
7.2.210.0050.00915.66
7.2.200.0040.01215.53
7.2.190.0080.00915.60
7.2.180.0090.00715.40
7.2.170.0060.00915.46
7.2.160.0090.00615.32
7.2.150.0130.00716.38
7.2.140.0080.01016.41
7.2.130.0090.00816.35
7.2.120.0070.00816.30
7.2.110.0120.00516.23
7.2.100.0060.01016.36
7.2.90.0060.01116.43
7.2.80.0110.00816.40
7.2.70.0330.00616.46
7.2.60.0090.01016.36
7.2.50.0080.01516.42
7.2.40.0090.00816.43
7.2.30.0090.00916.40
7.2.20.0070.00816.34
7.2.10.0140.00616.47
7.2.00.0100.01016.46
7.1.330.0080.01015.69
7.1.320.0110.00515.78
7.1.310.0040.01215.68
7.1.300.0090.01015.82
7.1.290.0080.00515.78
7.1.280.0060.00915.33
7.1.270.0080.00815.36
7.1.260.0130.00315.31
7.1.250.0050.00915.28
7.1.240.0050.01015.76
7.1.230.0040.01115.59
7.1.220.0130.00615.67
7.1.210.0050.00915.65
7.1.200.0070.00815.71
7.1.190.0070.00915.54
7.1.180.0050.01115.72
7.1.170.0080.01115.81
7.1.160.0090.00515.74
7.1.150.0090.00915.68
7.1.140.0070.00715.77
7.1.130.0070.00715.82
7.1.120.0030.01415.68
7.1.110.0050.01015.64
7.1.100.0060.00815.79
7.1.90.0060.00915.68
7.1.80.0080.00815.62
7.1.70.0080.00815.66
7.1.60.0110.00515.72
7.1.50.0030.01015.59
7.1.40.0070.00715.70
7.1.30.0070.00815.73
7.1.20.0060.00815.51
7.1.10.0070.00915.58
7.1.00.0080.00815.63
7.0.330.0140.00315.21
7.0.320.0230.02715.15
7.0.310.0040.01515.17
7.0.300.0110.00515.19
7.0.290.0090.00715.09
7.0.280.0130.00715.22
7.0.270.0030.01515.20
7.0.260.0030.01615.03
7.0.250.0040.01315.32
7.0.240.0120.00615.36
7.0.230.0110.00815.38
7.0.220.0140.00415.03
7.0.210.0090.01315.13
7.0.200.0060.01215.45
7.0.190.0080.00815.34
7.0.180.0030.01315.20
7.0.170.0160.00615.16
7.0.160.0080.00815.22
7.0.150.0130.00615.35
7.0.140.0060.01015.29
7.0.130.0040.01215.20
7.0.120.0070.01015.43
7.0.110.0030.01415.25
7.0.100.0110.00915.27
7.0.90.0100.00515.21
7.0.80.0100.00715.10
7.0.70.0070.01015.37
7.0.60.0110.01015.34
7.0.50.0160.00015.27
7.0.40.0040.01315.25
7.0.30.0060.01215.02
7.0.20.0210.00415.07
7.0.10.0060.01215.34
7.0.00.0200.00015.41
5.6.400.0140.00615.75
5.6.390.0090.00915.79
5.6.380.0060.01215.99
5.6.370.0090.01215.88
5.6.360.0130.00816.04
5.6.350.0040.02116.15
5.6.340.0090.01216.09
5.6.330.0140.00715.54
5.6.320.0070.01415.81
5.6.310.0120.00915.93
5.6.300.0130.00615.74
5.6.290.0080.01116.02
5.6.280.0110.00816.25
5.6.270.0110.01115.86
5.6.260.0070.01116.12
5.6.250.0180.00715.95
5.6.240.0160.00315.93
5.6.230.0060.01415.93
5.6.220.0070.01316.07
5.6.210.0060.01315.80
5.6.200.0070.01115.88
5.6.190.0030.01515.83
5.6.180.0110.00715.78
5.6.170.0130.00615.78
5.6.160.0130.01016.00
5.6.150.0100.01015.90
5.6.140.0110.00916.06
5.6.130.0150.01215.89
5.6.120.0100.01015.86
5.6.110.0100.01015.79
5.6.100.0060.01315.80
5.6.90.0060.01515.98
5.6.80.0070.01515.68
5.6.70.0180.00015.83
5.6.60.0110.01115.80
5.6.50.0160.00915.62
5.6.40.0140.01415.53
5.6.30.0110.01815.61
5.6.20.0210.00415.36
5.6.10.0110.01515.59
5.6.00.0120.01215.56
5.5.380.0190.01115.82
5.5.370.0120.02316.03
5.5.360.0180.01515.89
5.5.350.0180.01215.84
5.5.340.0220.00916.04
5.5.330.0170.01315.89
5.5.320.0160.01615.81
5.5.310.0280.00915.83
5.5.300.0230.01015.88
5.5.290.0260.00815.89
5.5.280.0140.01715.78
5.5.270.0230.01015.82
5.5.260.0150.01516.11
5.5.250.0250.00715.83
5.5.240.0190.01515.64
5.5.230.0270.00615.83
5.5.220.0220.00715.77
5.5.210.0260.00715.82
5.5.200.0260.01015.80
5.5.190.0220.01315.64
5.5.180.0250.01415.83
5.5.170.0160.01415.70
5.5.160.0060.02515.93
5.5.150.0200.01615.84
5.5.140.0280.00415.48
5.5.130.0210.01315.75
5.5.120.0150.01515.75
5.5.110.0310.00615.70
5.5.100.0210.01416.00
5.5.90.0260.00915.89
5.5.80.0160.01616.00
5.5.70.0190.01315.58
5.5.60.0280.00315.48
5.5.50.0220.01115.77
5.5.40.0170.03415.64
5.5.30.0210.01315.78
5.5.20.0220.00815.93
5.5.10.0150.01415.77
5.5.00.0240.00915.78
5.4.450.0160.01312.54
5.4.440.0190.00912.80
5.4.430.0200.00312.89
5.4.420.0210.00412.58
5.4.410.0170.00712.84
5.4.400.0170.00612.51
5.4.390.0150.00812.58
5.4.380.0130.01012.78
5.4.370.0130.01312.76
5.4.360.0230.00612.69
5.4.350.0270.00312.59
5.4.340.0290.00012.44
5.4.330.0180.00912.64
5.4.320.0220.00612.56
5.4.310.0120.01312.84
5.4.300.0190.00712.56
5.4.290.0150.01212.55
5.4.280.0160.00912.73
5.4.270.0260.00412.65
5.4.260.0140.01012.58
5.4.250.0200.01012.54
5.4.240.0140.01112.71
5.4.230.0170.01012.75
5.4.220.0170.00712.63
5.4.210.0130.01312.86
5.4.200.0210.00712.55
5.4.190.0220.00312.47
5.4.180.0180.00912.65
5.4.170.0210.00712.45
5.4.160.0110.01112.54
5.4.150.0190.00812.69
5.4.140.0120.01012.80
5.4.130.0110.01412.60
5.4.120.0140.01012.73
5.4.110.0160.00512.50
5.4.100.0260.00012.53
5.4.90.0180.01112.64
5.4.80.0180.00412.61
5.4.70.0170.00412.83
5.4.60.0160.01012.38
5.4.50.0200.00012.57
5.4.40.0150.00612.55
5.4.30.0140.00912.51
5.4.20.0120.01012.70
5.4.10.0120.01112.45
5.4.00.0100.01012.55
5.3.290.0200.00812.88
5.3.280.0160.00812.52
5.3.270.0370.02712.78
5.3.260.0200.00312.92
5.3.250.0170.00912.92
5.3.240.0130.01212.51
5.3.230.0160.00712.52
5.3.220.0110.01112.50
5.3.210.0230.00312.55
5.3.200.0180.00912.65
5.3.190.0180.00512.64
5.3.180.0130.01012.82
5.3.170.0210.00412.76
5.3.160.0110.01012.73
5.3.150.0120.01112.74
5.3.140.0150.01212.71
5.3.130.0150.00912.75
5.3.120.0150.00912.96
5.3.110.0160.00912.74
5.3.100.0130.00912.79
5.3.90.0090.01312.80
5.3.80.0100.01012.71
5.3.70.0100.01612.61
5.3.60.0120.01212.68
5.3.50.0170.00912.63
5.3.40.0140.01012.75
5.3.30.0160.00712.46
5.3.20.0140.00712.58
5.3.10.0170.00912.54
5.3.00.0120.01212.37
5.2.170.0120.00911.76
5.2.160.0120.00811.70
5.2.150.0070.01411.85
5.2.140.0150.00311.64
5.2.130.0180.00011.63
5.2.120.0090.00911.70
5.2.110.0150.00511.76
5.2.100.0110.01211.62
5.2.90.0100.01011.79
5.2.80.0100.01011.73
5.2.70.0110.01111.67
5.2.60.0090.00911.68
5.2.50.0120.00811.69
5.2.40.0060.01211.75
5.2.30.0120.00611.57
5.2.20.0150.00311.42
5.2.10.0060.01211.50
5.2.00.0110.00611.42
5.1.60.0120.00410.80
5.1.50.0100.00710.82
5.1.40.0100.00610.90
5.1.30.0070.01011.04
5.1.20.0150.00310.86
5.1.10.0130.00310.91
5.1.00.0080.00910.65
5.0.50.0000.01510.56
5.0.40.0120.00210.56
5.0.30.0140.00010.56
5.0.20.0110.00710.56
5.0.10.0090.00410.56
5.0.00.0110.00410.56
4.4.90.0110.00010.56
4.4.80.0020.00710.56
4.4.70.0060.00310.56
4.4.60.0040.00410.56
4.4.50.0040.00410.56
4.4.40.0090.00010.56
4.4.30.0050.00510.56
4.4.20.0060.00310.56
4.4.10.0060.00310.56
4.4.00.0050.00510.56
4.3.110.0000.00810.56
4.3.100.0100.00010.56
4.3.90.0100.00010.56
4.3.80.0070.00310.56
4.3.70.0100.00010.56
4.3.60.0090.00010.56
4.3.50.0100.00010.56
4.3.40.0070.00210.56
4.3.30.0000.00710.56
4.3.20.0030.00610.56
4.3.10.0000.00710.56
4.3.00.0000.00810.56

preferences:
40.73 ms | 401 KiB | 5 Q