3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'radios1' => [ 'on', ], 'empty' => [ '', ], 'from' => [ '', 'Bangalore', null, 0, ] ]; $result = []; foreach ($array as $key => $items) { foreach ($items as $item) { if ($item) { $result[$key][] = $item; } } } var_export($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.4.140.0100.01117.59
8.4.130.0040.00518.93
8.4.120.0100.01023.96
8.4.110.0130.00718.56
8.4.100.0090.01118.93
8.4.90.0120.00820.50
8.4.80.0070.00720.38
8.4.70.0160.00718.21
8.4.60.0130.00918.70
8.4.50.0110.00917.61
8.4.40.0120.00917.64
8.4.30.0060.01318.64
8.4.20.0040.01619.32
8.4.10.0050.00320.43
8.3.270.0140.00516.63
8.3.260.0140.00716.56
8.3.250.0110.00718.94
8.3.240.0050.00416.96
8.3.230.0090.00916.82
8.3.220.0130.00518.93
8.3.210.0070.00916.64
8.3.200.0030.00616.72
8.3.190.0130.00517.13
8.3.180.0110.00818.09
8.3.170.0110.00720.55
8.3.160.0120.00616.50
8.3.150.0080.01518.33
8.3.140.0040.00416.76
8.3.130.0080.00316.60
8.3.120.0040.00420.89
8.3.110.0120.00318.68
8.3.100.0090.00016.53
8.3.90.0000.00818.41
8.3.80.0090.00019.36
8.3.70.0090.00618.68
8.3.60.0120.00618.43
8.3.50.0080.00923.78
8.3.40.0100.01021.66
8.3.30.0140.00018.71
8.3.20.0050.00524.18
8.3.10.0080.00024.66
8.3.00.0080.00026.16
8.2.290.0100.00920.23
8.2.280.0060.00518.36
8.2.270.0110.00417.34
8.2.260.0030.01518.29
8.2.250.0180.00016.65
8.2.240.0050.00318.86
8.2.230.0040.00420.94
8.2.220.0120.00024.06
8.2.210.0100.01026.77
8.2.200.0040.00716.38
8.2.190.0150.00016.58
8.2.180.0120.00325.92
8.2.170.0070.01019.03
8.2.160.0030.01022.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0040.00426.35
8.2.110.0070.00321.04
8.2.100.0060.00617.84
8.2.90.0000.00818.03
8.2.80.0070.00317.97
8.2.70.0090.00018.05
8.2.60.0030.00618.16
8.2.50.0050.00318.10
8.2.40.0040.00419.46
8.2.30.0070.00019.32
8.2.20.0040.00418.13
8.2.10.0080.00021.00
8.2.00.0040.00419.38
8.1.330.0120.00621.89
8.1.320.0110.00916.03
8.1.310.0100.00718.24
8.1.300.0030.00619.71
8.1.290.0060.00318.88
8.1.280.0070.00725.92
8.1.270.0030.00523.99
8.1.260.0040.00428.09
8.1.250.0030.00628.09
8.1.240.0070.00322.65
8.1.230.0000.01120.96
8.1.220.0040.00417.74
8.1.210.0030.00618.98
8.1.200.0030.00617.35
8.1.190.0060.00317.23
8.1.180.0090.00018.10
8.1.170.0040.00418.54
8.1.160.0070.00018.93
8.1.150.0040.00418.86
8.1.140.0000.00718.89
8.1.130.0000.00720.14
8.1.120.0040.00417.49
8.1.110.0000.00817.40
8.1.100.0000.00717.48
8.1.90.0000.00817.37
8.1.80.0050.00317.36
8.1.70.0030.00317.47
8.1.60.0040.00417.48
8.1.50.0000.00817.45
8.1.40.0000.00817.41
8.1.30.0070.00017.63
8.1.20.0040.00417.64
8.1.10.0030.00517.35
8.1.00.0040.00417.35
8.0.300.0000.00820.02
8.0.290.0000.00816.63
8.0.280.0000.00718.46
8.0.270.0000.01018.61
8.0.260.0030.00318.41
8.0.250.0000.00716.88
8.0.240.0070.00016.92
8.0.230.0000.00816.85
8.0.220.0030.00316.89
8.0.210.0030.00316.88
8.0.200.0030.00316.89
8.0.190.0070.00016.85
8.0.180.0050.00216.83
8.0.170.0050.00316.94
8.0.160.0040.00416.98
8.0.150.0000.00716.91
8.0.140.0040.00416.89
8.0.130.0000.00513.29
8.0.120.0040.00416.75
8.0.110.0000.00717.01
8.0.100.0000.00716.70
8.0.90.0030.00516.94
8.0.80.0060.00816.83
8.0.70.0070.00016.96
8.0.60.0000.00716.93
8.0.50.0040.00416.75
8.0.30.0060.01217.21
8.0.20.0080.01117.04
8.0.10.0080.00017.02
8.0.00.0110.01416.73
7.4.330.0050.00015.55
7.4.320.0070.00016.50
7.4.300.0030.00316.50
7.4.290.0070.00016.48
7.4.280.0080.00016.51
7.4.270.0040.00416.46
7.4.260.0050.00013.27
7.4.250.0000.00816.61
7.4.240.0000.00716.66
7.4.230.0080.00016.35
7.4.220.0020.00616.49
7.4.210.0040.01116.62
7.4.200.0000.00716.48
7.4.130.0040.01416.44
7.4.120.0090.01516.48
7.4.110.0080.01416.48
7.4.100.0140.00715.94
7.4.90.0070.01616.27
7.4.80.0100.01016.11
7.4.70.0100.01416.12
7.4.60.0130.00616.32
7.4.50.0110.00716.11
7.4.40.0110.00716.20
7.4.30.0100.01316.07
7.4.20.0070.01116.32
7.4.10.0130.00816.36
7.4.00.0190.00616.23
7.3.330.0000.00716.41
7.3.320.0000.00713.15
7.3.310.0000.00716.24
7.3.300.0040.00416.37
7.3.290.0110.00516.40
7.3.260.0120.00916.30
7.3.230.0120.00616.04
7.3.220.0120.01216.25
7.3.210.0120.00616.39
7.3.200.0030.01916.23
7.3.190.0090.00916.36
7.3.180.0070.01116.18
7.3.170.0120.00816.26
7.3.160.0160.00616.38
7.3.150.0130.00716.19
7.3.140.0090.01616.24
7.3.130.0100.01016.65
7.3.120.0070.01116.21
7.3.110.0180.01116.50
7.3.100.0140.00916.58
7.3.90.0080.01516.33
7.3.80.0100.01116.46
7.3.70.0060.01416.49
7.3.60.0100.00716.47
7.3.50.0130.01016.18
7.3.40.0030.01516.30
7.3.30.0120.00916.34
7.3.20.0090.01116.54
7.3.10.0200.00316.43
7.3.00.0140.00816.29
7.2.340.0120.00916.29
7.2.330.0110.01116.34
7.2.320.0070.01616.45
7.2.310.0090.01216.30
7.2.300.0130.00616.24
7.2.290.0090.00916.66
7.2.280.0030.01916.41
7.2.270.0190.00316.16
7.2.260.0100.01116.38
7.2.250.0110.00716.50
7.2.240.0080.01216.27
7.2.230.0120.01416.52
7.2.220.0070.01416.64
7.2.210.0060.01316.71
7.2.200.0100.01016.49
7.2.190.0070.01616.38
7.2.180.0090.00916.54
7.2.170.0120.01216.63
7.2.160.0170.00716.43
7.2.150.0060.01416.48
7.2.140.0090.01616.70
7.2.130.0110.00816.63
7.2.120.0450.01216.33
7.2.110.0110.01116.48
7.2.100.0100.01016.35
7.2.90.0120.01416.28
7.2.80.0230.00016.41
7.2.70.0160.00816.52
7.2.60.0110.01116.64
7.2.50.0140.00816.61
7.2.40.0140.00616.41
7.2.30.0170.01016.59
7.2.20.0090.01216.68
7.2.10.0110.00816.61
7.2.00.0070.01116.43

preferences:
30.23 ms | 403 KiB | 5 Q