3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'a' => 'a', 'b' => '', 'c' => null, 'd' => 122, 'e' => 0, 'f' => [ 'g' => 'g', 'h' => 0, 'i' => null, 'j' => '' ] ]; $result = array_filter($array, function ($arr) { if (!is_array($arr)) { return strlen($arr) ; } return array_filter($arr) ; } ) ; var_dump($result);

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.0130.00618.43
8.3.50.0070.01116.20
8.3.40.0120.00318.84
8.3.30.0150.00018.67
8.3.20.0040.00418.98
8.3.10.0050.00320.90
8.3.00.0080.00019.69
8.2.180.0030.00916.50
8.2.170.0120.00322.96
8.2.160.0030.01020.77
8.2.150.0050.00324.18
8.2.140.0060.00324.66
8.2.130.0030.00519.64
8.2.120.0000.00826.35
8.2.110.0070.00322.14
8.2.100.0060.00617.91
8.2.90.0040.00417.63
8.2.80.0000.00818.74
8.2.70.0000.00917.92
8.2.60.0040.00417.93
8.2.50.0040.00418.10
8.2.40.0000.00819.34
8.2.30.0000.00719.46
8.2.20.0040.00417.97
8.2.10.0040.00418.19
8.2.00.0030.00319.50
8.1.280.0130.00325.92
8.1.270.0060.00323.96
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0030.00623.92
8.1.230.0080.00320.93
8.1.220.0090.00018.50
8.1.210.0080.00018.77
8.1.200.0050.00317.35
8.1.190.0040.00417.35
8.1.180.0000.00718.10
8.1.170.0080.00018.50
8.1.160.0040.00418.77
8.1.150.0040.00418.85
8.1.140.0040.00417.78
8.1.130.0000.00719.06
8.1.120.0040.00717.51
8.1.110.0070.00017.45
8.1.100.0050.00217.36
8.1.90.0040.00417.44
8.1.80.0030.00517.47
8.1.70.0000.00717.41
8.1.60.0050.00317.63
8.1.50.0000.00817.42
8.1.40.0050.00317.57
8.1.30.0000.00917.65
8.1.20.0050.00217.63
8.1.10.0000.00817.42
8.1.00.0030.00617.30
8.0.300.0070.00018.77
8.0.290.0000.00816.75
8.0.280.0000.00818.36
8.0.270.0000.00717.21
8.0.260.0000.00719.01
8.0.250.0000.00616.99
8.0.240.0040.00416.96
8.0.230.0030.00316.93
8.0.220.0000.00816.77
8.0.210.0000.00716.90
8.0.200.0000.00716.94
8.0.190.0080.00016.87
8.0.180.0070.00016.90
8.0.170.0030.00616.92
8.0.160.0040.00416.96
8.0.150.0000.00716.90
8.0.140.0080.00016.86
8.0.130.0030.00313.38
8.0.120.0050.00316.86
8.0.110.0040.00416.67
8.0.100.0040.00416.80
8.0.90.0040.00416.78
8.0.80.0110.01116.90
8.0.70.0050.00216.80
8.0.60.0080.00016.75
8.0.50.0000.00816.79
8.0.30.0130.00717.07
8.0.20.0110.00817.40
8.0.10.0070.00016.96
8.0.00.0070.01116.70
7.4.330.0060.00015.55
7.4.320.0070.00016.61
7.4.300.0000.00616.58
7.4.290.0070.00016.42
7.4.280.0050.00216.64
7.4.270.0060.00316.55
7.4.260.0070.00016.49
7.4.250.0070.00016.46
7.4.240.0070.00016.47
7.4.230.0030.00316.71
7.4.220.0090.00016.41
7.4.210.0090.00816.56
7.4.200.0000.00716.25
7.4.160.0100.00616.43
7.4.140.0160.00917.86
7.4.130.0070.01116.62
7.4.120.0110.00716.59
7.4.110.0150.00416.62
7.4.100.0090.00916.39
7.4.90.0120.00616.62
7.4.80.0150.00319.39
7.4.70.0110.00516.59
7.4.60.0030.01316.44
7.4.50.0090.00616.38
7.4.40.0060.01116.61
7.4.00.0070.00714.79
7.3.330.0050.00013.12
7.3.320.0040.00413.07
7.3.310.0000.00716.33
7.3.300.0070.00016.22
7.3.290.0040.00416.14
7.3.280.0070.00916.29
7.3.260.0150.00916.53
7.3.240.0110.00716.44
7.3.230.0120.00616.37
7.3.210.0090.01216.58
7.3.200.0160.00016.24
7.3.190.0100.00716.51
7.3.180.0130.00316.66
7.3.170.0110.01116.26
7.3.160.0160.00616.48
7.3.10.0030.01016.54
7.3.00.0000.01516.82
7.2.330.0150.01216.63
7.2.320.0030.01316.65
7.2.310.0070.01316.60
7.2.300.0130.00816.52
7.2.290.0060.01816.52
7.2.130.0030.01216.95
7.2.120.0030.01016.83
7.2.110.0100.01017.07
7.2.100.0080.01116.99
7.2.90.0110.00416.76
7.2.80.0070.01016.68
7.2.70.0090.00616.95
7.2.60.1260.00716.12
7.2.50.1060.00515.97
7.2.40.1100.00816.12
7.2.30.1000.00716.36
7.2.20.0990.00916.10
7.2.10.1160.01216.09
7.2.00.0930.00716.24
7.1.250.0030.01015.75
7.1.200.0060.00615.62
7.1.170.2180.00714.01
7.1.160.2020.01117.04
7.1.150.1760.01116.88
7.1.140.2150.00716.59
7.1.130.1930.01016.67
7.1.120.2160.01116.49
7.1.110.2150.01015.93
7.1.100.2240.01015.96
7.1.90.2510.01215.85
7.1.80.2390.01216.37
7.1.70.2510.01315.40
7.1.60.2460.01232.88
7.1.50.2590.01433.04
7.1.40.2590.02232.61
7.1.30.2700.01732.63
7.1.20.3180.02232.65
7.1.10.3040.01114.61
7.1.00.2440.00914.83

preferences:
34.03 ms | 400 KiB | 5 Q