3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'test' => [ 'access' => 111, 'aa' => [ 'access' => 222, 'bb' => 333 ], ], 'access' => 444, 'value' => 555 ]; function removeIfNotArrayAndNotSiblingOfAccess($array) { foreach ($array as $key => &$value) { if (is_array($value)) { $value = (__FUNCTION__)($value); } elseif ($key != 'access') { unset($array[$key]); } } return $array; } var_export(removeIfNotArrayAndNotSiblingOfAccess($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.5.00.0140.00820.06
8.4.150.0010.00114.05
8.4.140.0140.00717.43
8.4.130.0110.00917.91
8.4.120.0120.00922.35
8.4.110.0130.00722.39
8.4.100.0130.00717.63
8.4.90.0120.00818.45
8.4.80.0120.00617.75
8.4.70.0110.00917.73
8.4.60.0130.00619.62
8.4.50.0050.00517.66
8.4.40.0090.00917.38
8.4.30.0070.01122.45
8.4.20.0150.00418.87
8.4.10.0030.00621.21
8.3.280.0150.00818.43
8.3.270.0140.00516.41
8.3.260.0080.01016.76
8.3.250.0100.00619.02
8.3.240.0090.01016.54
8.3.230.0090.01016.64
8.3.220.0080.01017.05
8.3.210.0110.01016.77
8.3.200.0110.00516.81
8.3.190.0120.00716.44
8.3.180.0120.00716.64
8.3.170.0110.00719.10
8.3.160.0110.00718.25
8.3.150.0050.00320.92
8.3.140.0030.00616.57
8.3.130.0090.00916.90
8.3.120.0090.00619.10
8.3.110.0120.00320.94
8.3.100.0030.00624.06
8.3.90.0070.00326.77
8.3.80.0040.00416.63
8.3.70.0090.00618.50
8.3.60.0150.00016.50
8.3.50.0070.01418.57
8.3.40.0120.00320.21
8.3.30.0100.00321.79
8.3.20.0040.00424.18
8.3.10.0050.00224.66
8.3.00.0080.00026.16
8.2.290.0060.00420.57
8.2.280.0060.00418.30
8.2.270.0120.00617.34
8.2.260.0070.01118.12
8.2.250.0070.00418.57
8.2.240.0050.00519.03
8.2.230.0050.00522.58
8.2.220.0060.00337.54
8.2.210.0120.00626.77
8.2.200.0040.00416.38
8.2.190.0130.00316.58
8.2.180.0070.01018.42
8.2.170.0160.00318.86
8.2.160.0110.00422.96
8.2.150.0070.00025.66
8.2.140.0000.00824.66
8.2.130.0090.00026.16
8.2.120.0000.00721.00
8.2.110.0190.00322.02
8.2.100.0120.01221.03
8.2.90.0240.01218.95
8.2.80.0240.00718.86
8.2.70.0320.00318.86
8.2.60.0360.00318.89
8.2.50.0170.01018.70
8.2.40.0220.01018.86
8.2.30.0180.00718.57
8.2.20.0230.01018.83
8.2.10.0270.00819.27
8.2.00.0220.01519.25
8.1.330.0120.00721.76
8.1.320.0090.01116.32
8.1.310.0080.00018.51
8.1.300.0100.00715.92
8.1.290.0060.00318.88
8.1.280.0140.00625.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0180.01518.44
8.1.230.0290.00718.44
8.1.220.0060.00918.39
8.1.210.0080.01619.63
8.1.200.0090.00618.42
8.1.190.0090.00418.51
8.1.180.0290.00018.31
8.1.170.0090.00318.48
8.1.160.0090.00620.39
8.1.150.0130.00020.40
8.1.140.0120.00318.38
8.1.130.0210.00018.34
8.1.120.0090.00618.69
8.1.110.0080.00818.68
8.1.100.0110.00518.72
8.1.90.0070.00718.58
8.1.80.0120.00418.33
8.1.70.0160.00318.64
8.1.60.0200.00018.57
8.1.50.0150.00418.58
8.1.40.0180.00418.68
8.1.30.0210.01018.80
8.1.20.0190.00918.71
8.1.10.0300.00318.43
8.1.00.0050.01018.52
8.0.300.0340.00317.93
8.0.290.0190.00417.79
8.0.280.0090.00617.81
8.0.270.0110.00417.90
8.0.260.0340.00317.83
8.0.250.0180.00617.89
8.0.240.0220.00617.96
8.0.230.0230.00718.25
8.0.220.0170.01417.93
8.0.210.0130.00317.80
8.0.200.0250.01317.86
8.0.190.0260.01717.77
8.0.180.0150.01517.86
8.0.170.0120.00617.87
8.0.160.0220.00617.77
8.0.150.0230.01017.88
8.0.140.0250.00017.75
8.0.130.0050.00818.24
8.0.120.0260.01317.68
8.0.110.0120.00317.88
8.0.100.0180.00617.94
8.0.90.0170.01317.93
8.0.80.0150.00417.78
8.0.70.0080.00817.83
8.0.60.0190.00417.70
8.0.50.0350.00417.83
8.0.30.0120.00817.95
8.0.20.0200.01318.00
8.0.10.0150.00418.05

preferences:
38.3 ms | 403 KiB | 5 Q