3v4l.org

run code in 300+ PHP versions simultaneously
<?php function recursive_select($data, callable $callback, $flag = \RecursiveIteratorIterator::SELF_FIRST, $preserve_keys = FALSE) { return iterator_to_array(new \CallbackFilterIterator(new \RecursiveIteratorIterator(new \RecursiveArrayIterator($data), $flag), $callback), $preserve_keys); } $multi=[['A',['B',['CC','CCCC','CCCCCC'],['DDD','EFG','HIJ','LMNOP']]],['2'],'b',[[],[],[]]]; $array = array(1,2,[3,4],5,'six',array(array('78',9)),10); $multi_output = recursive_select($multi, function ($value) { return is_string($value); }); $array_output = recursive_select($array, function ($value) { return is_numeric($value) || is_string($value); }); var_dump($multi_output, $array_output);

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.0090.00616.50
8.3.50.0120.00916.04
8.3.40.0070.00718.97
8.3.30.0120.00318.75
8.3.20.0050.00220.35
8.3.10.0000.00821.92
8.3.00.0100.00023.48
8.2.180.0040.01125.92
8.2.170.0040.01118.83
8.2.160.0100.00322.13
8.2.150.0070.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00420.52
8.2.120.0000.00726.35
8.2.110.0100.00022.13
8.2.100.0050.00517.72
8.2.90.0050.00319.28
8.2.80.0080.00017.97
8.2.70.0040.00417.50
8.2.60.0000.00917.80
8.2.50.0050.00318.07
8.2.40.0060.00320.07
8.2.30.0000.00818.14
8.2.20.0050.00318.36
8.2.10.0080.00018.13
8.2.00.0040.00418.01
8.1.280.0110.00425.92
8.1.270.0040.00423.91
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.01020.77
8.1.230.0040.01317.70
8.1.220.0040.00417.77
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0030.00517.25
8.1.180.0040.00418.10
8.1.170.0040.00418.31
8.1.160.0040.00418.85
8.1.150.0040.00418.83
8.1.140.0040.00717.34
8.1.130.0050.00319.03
8.1.120.0000.00817.38
8.1.110.0060.00317.53
8.1.100.0040.00417.47
8.1.90.0040.00417.50
8.1.80.0070.00317.50
8.1.70.0000.00717.43
8.1.60.0040.00417.65
8.1.50.0040.00417.54
8.1.40.0000.00817.54
8.1.30.0050.00317.74
8.1.20.0040.00417.65
8.1.10.0000.00817.53
8.1.00.0050.00317.39
8.0.300.0040.00420.02
8.0.290.0000.00816.75
8.0.280.0000.00818.37
8.0.270.0040.00417.32
8.0.260.0000.00718.48
8.0.250.0070.00017.05
8.0.240.0050.00316.92
8.0.230.0040.00416.94
8.0.220.0030.00316.87
8.0.210.0000.00717.00
8.0.200.0070.00017.01
8.0.190.0040.00417.11
8.0.180.0070.00016.96
8.0.170.0040.00416.98
8.0.160.0000.00716.93
8.0.150.0040.00416.87
8.0.140.0040.00416.96
8.0.130.0060.00013.36
8.0.120.0080.00016.92
8.0.110.0040.00417.00
8.0.100.0000.00716.94
8.0.90.0040.00416.91
8.0.80.0070.01017.01
8.0.70.0080.00016.83
8.0.60.0080.00016.81
8.0.50.0050.00317.07
8.0.30.0070.01317.20
8.0.20.0120.00817.41
8.0.10.0040.00417.05
8.0.00.0120.00616.68
7.4.330.0000.00415.55
7.4.320.0030.00316.63
7.4.300.0060.00016.52
7.4.290.0080.00016.49
7.4.280.0040.00416.53
7.4.270.0080.00016.47
7.4.260.0040.00216.55
7.4.250.0050.00316.63
7.4.240.0050.00216.52
7.4.230.0050.00316.71
7.4.220.0130.01016.63
7.4.210.0090.00616.72
7.4.200.0000.00716.63
7.4.160.0110.00816.57
7.4.150.0150.00617.40
7.4.140.0120.00817.86
7.4.130.0150.00416.56
7.4.120.0080.01216.46
7.4.110.0140.00616.57
7.4.100.0030.01316.34
7.4.90.0090.00916.61
7.4.80.0160.00919.39
7.4.70.0130.00516.41
7.4.60.0030.01216.38
7.4.50.0060.00516.59
7.4.40.0100.00716.52
7.4.30.0070.01016.58
7.4.10.0060.01014.84
7.4.00.0080.00715.00
7.3.330.0050.00013.26
7.3.320.0030.00313.09
7.3.310.0000.00816.21
7.3.300.0000.00716.31
7.3.290.0100.00516.28
7.3.280.0090.00716.24
7.3.270.0180.00317.40
7.3.260.0120.00816.50
7.3.250.0100.00916.40
7.3.240.0120.00616.47
7.3.230.0060.01016.34
7.3.210.0170.01016.31
7.3.200.0070.01116.21
7.3.190.0070.01516.23
7.3.180.0040.01816.32
7.3.170.0050.01116.48
7.3.160.0160.00016.36
7.3.130.0110.00714.91
7.3.120.0110.00614.57
7.3.110.0050.01214.68
7.3.100.0070.00914.76
7.3.90.0090.00514.63
7.3.80.0100.00314.74
7.3.70.0030.01114.64
7.3.60.0020.01214.83
7.3.50.0070.00714.42
7.3.40.0050.00914.70
7.3.30.0030.01214.47
7.3.20.0060.00616.64
7.3.10.0100.00516.55
7.3.00.0110.00316.42
7.2.330.0060.01116.82
7.2.320.0090.00916.72
7.2.310.0180.00616.69
7.2.300.0120.00416.86
7.2.290.0090.00916.81
7.2.260.0150.00315.07
7.2.250.0060.01114.92
7.2.240.0090.00615.07
7.2.230.0090.00515.03
7.2.220.0040.01115.07
7.2.210.0030.01015.08
7.2.200.0080.00315.14
7.2.190.0100.00515.08
7.2.180.0080.00715.09
7.2.170.0060.00915.08
7.2.160.0100.00515.19
7.2.150.0050.01117.04
7.2.140.0050.00817.01
7.2.130.0070.00916.87
7.2.120.0000.01116.87
7.2.110.0050.00816.92
7.2.100.0060.00817.03
7.2.90.0060.00917.06
7.2.80.0030.00916.84
7.2.70.0090.00517.01
7.2.60.0060.00916.92
7.2.50.0050.00816.88
7.2.40.0050.00917.07
7.2.30.0060.01016.95
7.2.20.0000.01316.90
7.2.10.0090.00816.96
7.2.00.0030.00717.09
7.1.330.0030.01115.89
7.1.320.0070.00515.58
7.1.310.0050.00715.76
7.1.300.0070.00515.50
7.1.290.0030.00815.67
7.1.280.0000.01415.68
7.1.270.0050.00815.70
7.1.260.0040.00815.82
7.1.250.0060.00815.78
7.1.240.0070.00415.93
7.1.230.0040.00715.70
7.1.220.0030.00715.59
7.1.210.0050.00915.58
7.1.200.0050.00715.77
7.1.190.0030.01015.72
7.1.180.0070.00715.71
7.1.170.0050.00715.84
7.1.160.0080.00315.83
7.1.150.0050.01215.68
7.1.140.0080.00615.69
7.1.130.0030.01015.80
7.1.120.0050.00815.89
7.1.110.0030.00915.63
7.1.100.0350.00815.94
7.1.90.0430.00915.95
7.1.80.0380.00715.90
7.1.70.0330.01015.72
7.1.60.0660.01121.72
7.1.50.0600.00321.42
7.1.40.0360.00621.29
7.1.30.0440.01221.43
7.1.20.0490.00921.32
7.1.10.0410.00815.28
7.1.00.0400.00815.34
7.0.330.0030.01015.28
7.0.320.0020.01315.25
7.0.310.0020.00915.24
7.0.300.0080.00515.29
7.0.290.0050.00815.29
7.0.280.0050.00615.52
7.0.270.0040.01115.21
7.0.260.0090.00615.32
7.0.250.0060.01015.47
7.0.240.0390.01315.62
7.0.230.0400.00815.67
7.0.220.0420.01115.57
7.0.210.0440.00715.18
7.0.200.0290.00815.28
7.0.190.0330.00815.29
7.0.180.0400.00915.11
7.0.170.0390.00714.97
7.0.160.0360.01015.03
7.0.150.0470.00915.13
7.0.140.0310.01214.89
7.0.130.0450.00815.30
7.0.120.0430.01115.19
7.0.110.0410.00915.06
7.0.100.0440.01315.00
7.0.90.0310.00714.96
7.0.80.0280.00915.15
7.0.70.0360.00915.12
7.0.60.0400.00915.01
7.0.50.0400.00815.10
7.0.40.0440.00913.86
7.0.30.0390.00813.79
7.0.20.0460.00813.92
7.0.10.0470.00613.96
7.0.00.0240.01313.98
5.6.400.0070.00514.61
5.6.390.0100.00614.14
5.6.380.0070.00814.55
5.6.370.0030.00714.13
5.6.360.0070.00514.22
5.6.350.0050.00714.34
5.6.340.0080.00914.19
5.6.330.0060.00514.38
5.6.320.0090.00314.53
5.6.310.0050.00814.25
5.6.300.0050.00514.20
5.6.290.0060.00514.25
5.6.280.0100.00414.47
5.6.270.0040.00914.30
5.6.260.0080.00714.52
5.6.250.0100.00214.31
5.6.240.0040.01014.21
5.6.230.0000.01214.47
5.6.220.0030.00914.34
5.6.210.0050.00914.22
5.6.200.0020.01414.31
5.6.190.0030.01114.37
5.6.180.0070.00514.15
5.6.170.0070.00614.30
5.6.160.0020.01114.29
5.6.150.0080.00314.25
5.6.140.0070.00814.27
5.6.130.0070.00514.30
5.6.120.0110.00314.30
5.6.110.0030.01214.22
5.6.100.0030.01214.37
5.6.90.0080.00814.34
5.6.80.0070.00714.10
5.6.70.0020.01114.13
5.6.60.0000.01214.22
5.6.50.0030.01414.25
5.6.40.0050.00614.22
5.6.30.0060.00614.28
5.6.20.0060.00814.26
5.6.10.0050.00514.16
5.6.00.0050.01014.18

preferences:
64.33 ms | 400 KiB | 5 Q