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) ; } ) ; $r = array_filter($array) ; var_dump($r);

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.40.0090.00618.70
8.3.30.0070.00718.84
8.3.20.0040.00418.98
8.3.10.0000.00820.79
8.3.00.0030.00519.68
8.2.170.0060.01322.96
8.2.160.0100.00320.77
8.2.150.0020.00524.18
8.2.140.0040.00424.66
8.2.130.0050.00319.82
8.2.120.0050.00226.35
8.2.110.0030.00720.84
8.2.100.0090.00317.47
8.2.90.0050.00317.70
8.2.80.0000.00818.61
8.2.70.0030.00617.80
8.2.60.0060.00317.68
8.2.50.0000.00818.10
8.2.40.0050.00321.07
8.2.30.0040.00419.45
8.2.20.0060.00318.17
8.2.10.0030.00518.12
8.2.00.0000.00719.49
8.1.270.0080.00023.96
8.1.260.0000.00826.35
8.1.250.0060.00328.09
8.1.240.0070.00319.16
8.1.230.0070.00317.76
8.1.220.0080.00017.79
8.1.210.0040.00418.77
8.1.200.0000.00817.35
8.1.190.0040.00417.13
8.1.180.0000.00818.10
8.1.170.0000.00918.52
8.1.160.0040.00418.82
8.1.150.0070.00018.93
8.1.140.0070.00017.75
8.1.130.0030.00318.93
8.1.120.0080.00317.39
8.1.110.0050.00217.43
8.1.100.0040.00417.41
8.1.90.0040.00417.37
8.1.80.0000.00717.46
8.1.70.0050.00217.37
8.1.60.0040.00417.64
8.1.50.0040.00417.56
8.1.40.0000.00717.54
8.1.30.0000.00717.55
8.1.20.0000.00717.57
8.1.10.0000.00817.43
8.1.00.0040.00417.41
8.0.300.0000.00918.77
8.0.290.0030.00616.75
8.0.280.0000.00718.32
8.0.270.0030.00317.26
8.0.260.0070.00019.04
8.0.250.0000.00716.89
8.0.240.0000.00716.99
8.0.230.0030.00416.95
8.0.220.0050.00216.94
8.0.210.0000.00716.77
8.0.200.0000.00617.01
8.0.190.0050.00316.86
8.0.180.0000.00716.86
8.0.170.0040.00416.89
8.0.160.0070.00016.89
8.0.150.0040.00416.80
8.0.140.0030.00516.86
8.0.130.0060.00013.31
8.0.120.0070.00016.84
8.0.110.0070.00016.86
8.0.100.0030.00516.93
8.0.90.0040.00416.87
8.0.80.0120.01016.88
8.0.70.0040.00416.68
8.0.60.0040.00416.79
8.0.50.0000.00716.98
8.0.30.0100.01117.06
8.0.20.0080.01017.41
8.0.10.0040.00417.06
8.0.00.0020.01616.85
7.4.330.0000.00515.55
7.4.320.0040.00416.45
7.4.300.0000.00616.61
7.4.290.0000.00616.57
7.4.280.0000.00716.55
7.4.270.0030.00616.41
7.4.260.0040.00416.60
7.4.250.0050.00216.39
7.4.240.0070.00016.66
7.4.230.0040.00416.49
7.4.220.0050.00216.68
7.4.210.0060.00916.64
7.4.200.0040.00416.32
7.4.160.0100.00616.49
7.4.140.0120.00917.86
7.4.130.0090.00916.45
7.4.120.0100.01016.56
7.4.110.0030.01416.51
7.4.100.0120.01216.47
7.4.90.0160.00016.53
7.4.80.0090.01519.39
7.4.70.0030.01516.58
7.4.60.0030.01316.47
7.4.50.0070.00716.42
7.4.40.0070.01016.46
7.4.00.0040.01214.88
7.3.330.0000.00613.12
7.3.320.0070.00013.09
7.3.310.0030.00316.29
7.3.300.0040.00416.30
7.3.290.0030.00316.32
7.3.280.0090.00616.31
7.3.260.0080.01016.34
7.3.240.0120.00816.50
7.3.230.0130.00416.50
7.3.210.0160.00616.50
7.3.200.0040.01516.64
7.3.190.0060.01616.52
7.3.180.0130.00316.23
7.3.170.0060.01516.56
7.3.160.0060.01616.39
7.3.10.0030.00716.73
7.3.00.0030.00916.55
7.2.330.0160.01016.62
7.2.320.0130.00716.59
7.2.310.0060.01216.68
7.2.300.0090.00916.44
7.2.290.0170.00316.74
7.2.130.0080.00416.63
7.2.120.0030.01017.14
7.2.110.0100.00616.93
7.2.100.0110.00416.95
7.2.90.0130.00317.09
7.2.80.0060.00616.93
7.2.70.0030.00617.07
7.2.60.1420.01016.02
7.2.50.1360.00715.99
7.2.40.1160.00615.96
7.2.30.1250.00716.27
7.2.20.0810.00716.15
7.2.10.0890.00815.90
7.2.00.1680.01015.86
7.1.250.0040.00415.62
7.1.200.0060.00615.80
7.1.170.2410.00413.83
7.1.160.2380.01016.79
7.1.150.2550.01016.82
7.1.140.1950.01016.66
7.1.130.1820.01016.47
7.1.120.1870.00916.54
7.1.110.2420.01016.04
7.1.100.2380.00916.00
7.1.90.2440.00815.85
7.1.80.2190.00816.25
7.1.70.2270.01115.15
7.1.60.2100.01633.06
7.1.50.3700.01432.98
7.1.40.4160.01532.69
7.1.30.3940.01132.63
7.1.20.4080.01232.66
7.1.10.4140.00814.63
7.1.00.2490.01114.84

preferences:
45.41 ms | 400 KiB | 5 Q